Antergos / Cnchi

A modern, flexible online system installer for Antergos Linux
GNU General Public License v3.0
291 stars 101 forks source link

[Suggestion] Use systemd-swap #740

Open NanoSector opened 7 years ago

NanoSector commented 7 years ago

The systemd-swap daemon can automatically probe swap partitions and create swap files: https://github.com/Nefelim4ag/systemd-swap

It's in the community repository and should need minimal configuration.

Using this daemon we could theoretically eliminate having to create a swap partition. This has advantages, as the Arch Wiki mentions:

As an alternative to creating an entire partition, a swap file offers the ability to vary its size on-the-fly, and is more easily removed altogether. This may be especially desirable if disk space is at a premium (e.g. a modestly-sized SSD).

In this case just stopping the daemon will stop the use of swap altogether.

Note that BTRFS does NOT support swap files so a partition is still required.

karasu commented 7 years ago

Not sure about this one... now swap will be controlled by systemd, too? :grin:

Well, avoiding the systemd philosophical debate, @lots0logs what do you think about this one? Should I modify Cnchi to use systemd-swap? (but use a partition if btrfs is used as root system).

karasu commented 7 years ago

It seems that "Swap File Universal" supports btrfs. Looks interesting. It also can setup zram or zswap if wanted.

lots0logs commented 7 years ago

@karasu When I seen this issue earlier I assumed this was something new from systemd (officially). I see now that its not. If you think it would make things easier for us then I'm okay with it. So in other words, its up to you! :stuck_out_tongue_winking_eye:

karasu commented 7 years ago

Then I'll add it to my "maybe" TODO list 😬

Implementing this it's not straightforward as it seems as the automated partitioning code must be changed, too.

I've read that Ubuntu will go this way (I don't know if this is good or bad).