Add support for SWAP in a secondary persistent storage

Issue #9 resolved
Rebek Kahn created an issue

Hi,

I want to use a different device for the SWAP partition. Any idea to put it on a secondary persistent storage? Perhaps with a different magic header like "lightwhale-please-make-swap" for example?

Thank you.

Comments (6)

  1. Rebek Kahn reporter

    Hi Stephan,

    I discovered a method to create the SWAP partition (or multiple of it). You only need to boot with the no swap option when you want to initialize the persistence. With this strategy no swap will be added to your persistent storage. And after that you only need to do this stuff:

    • Partition the new disk with GPT.
    • Create a new swap partition with the label “lightwhale-swap".
    • Format the swap space with the “mkswap” command.

    After these steps any “swapon” command (automatically executed at each boot) will use the swap partition.

    I suggest to comment this in the README.

    Thank you for this useful project.

  2. Stephan Henningsen

    Hey Rebek,

    Well done! That was quite skilled of you to find that option! Not that it’s secret on any way, it’s just not as well-documented as I'd like it to be. It’s actual only documented in SYSLINUX menus when booting using BIOS. And in source, of course.

    (continued…)

  3. Stephan Henningsen

    I’m back ;) So yes, boot with “lightwhale noswap” to avoid creating swap. Lightwhale will pick up any swap partition using swapon -a, no matter how its named.

    I consider the boot parameter somewhat of a hack. I think at some point I’ll address this with a more advanced magic label, e.g. lightwhale-please-format-me:data vs. lightwhale-please-format-me:data+swap

  4. Log in to comment