Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heads up, PR to drop legacy swap startup in fedora kickstarts #133

Closed
cmurf opened this issue Jul 16, 2019 · 5 comments
Closed

heads up, PR to drop legacy swap startup in fedora kickstarts #133

cmurf opened this issue Jul 16, 2019 · 5 comments

Comments

@cmurf
Copy link

cmurf commented Jul 16, 2019

I just want to give livecd-tools folks a heads up in case they want to nack this PR:
https://pagure.io/fedora-kickstarts/pull-request/544#

Anaconda now automatically starts swap on ZRAM on low memory systems, so doing swapon for existing swap partitions isn't necessary. But then I thought, oh maybe someone uses livecd-iso-to-disk for a portable system and needs/wants --swap-size-mb flag to create a swapfile, and if so my PR, if merged, would mean the swapfile is silently not used.

Two alternatives to the proposed clean up:
Changing the swapon section to apply only to /run/initramfs/live/${livedir}/swap.img so that no other swap partition or LV is enabled.

Drop --swap-size-mb in favor of e.g. --swapforce which would add two boot parameters inst.zram=1 systemd.wants=zram.service. I've tested this on a VM with 3G RAM, and the first option causes anaconda/zramswapon to be forced even if memory is more than 2G, and the second directly starts zram.service rather than requiring anaconda to be launched.

Using swap on ZRAM will give way better performance than swapfile on flash drive.

@Conan-Kudo
Copy link
Member

@FGrose Can you take a look at this and see what we need to do, if anything?

@cmurf
Copy link
Author

cmurf commented Jul 28, 2019

re: inst.zram=1 systemd.wants=zram.service triggers anaconda's swap on zram service unit, i.e. it's only going to work if anaconda is on the live image, which perhaps isn't a certainty.

There's an unrelated zram package in Fedora being used mainly by IoT folks right now
https://src.fedoraproject.org/rpms/zram

And work on a generic solution in systemd
https://github.com/systemd/zram-generator

Ideally this will converge on the systemd zram generator, and use that in base as a generic swap on zram implementation. And at that time it'll make sense for anaconda folks to depend on it, and livecd-tools can more seriously consider dropping swapfiles.

Until the dust settles, I don't think it makes sense to flat out break livecd-tools --swap-size-mb, so looking at:
https://pagure.io/fedora-kickstarts/pull-request/544#request_diff
Does it make sense to keep lines 5, 12-14 instead of what I've proposed? Pretty sure that means only a swapfile on a LiveOS as created by livecd-tools would be enabled. I'm not aware of any use case with a USB stick and l-i-t-d depending on a swap partition or LV.

@Conan-Kudo
Copy link
Member

Until the dust settles, I don't think it makes sense to flat out break livecd-tools --swap-size-mb, so looking at:
https://pagure.io/fedora-kickstarts/pull-request/544#request_diff
Does it make sense to keep lines 5, 12-14 instead of what I've proposed? Pretty sure that means only a swapfile on a LiveOS as created by livecd-tools would be enabled.

Yeah, that probably makes sense...

@cmurf
Copy link
Author

cmurf commented Jul 28, 2019

Another factor in favor of swap on zram, and livecd-tools dropping swapfiles in favor of it, is the security angle. The swapfile isn't encrypted.

@cmurf
Copy link
Author

cmurf commented Jul 30, 2019

@cmurf cmurf closed this as completed Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants