-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Add swapoff flag #454
base: main
Are you sure you want to change the base?
Add swapoff flag #454
Conversation
@@ -619,7 +625,9 @@ if [[ ${phases[reboot]} == 1 ]]; then | |||
if command -v zpool >/dev/null && [ "\$(zpool list)" != "no pools available" ]; then | |||
# we always want to export the zfs pools so people can boot from it without force import | |||
umount -Rv /mnt/ | |||
swapoff -a | |||
if [[ ${swapoff} == "y" ]]; then | |||
swapoff -a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I don't like about this change is that it breaks the export the when people have swap on ZFS.
People shouldn't need to have adding a flag to make nixos-anywhere work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something like this is more sensible:
swapoff -a | |
# turn all swap devices that are baked by zfs. | |
swapon --show --noheadings | awk '/^\/dev\/zd/ {print $1}' | while read device; do | |
swapoff "$device" | |
done |
You would need to have your system not have swap in zfs. However you need to do this anyway because with 1GB you would run into deadlock issues with zfs if you would try to have it in the pool.
This is a fix for #450.
Adds a flag
--swapoff
which enables the features added in #421.So now, by default,
swapoff -a
will not run during the reboot phase. Only when you have a ZFS swap device would you need to pass the--swapoff
flag. This way users who are using a swap device during the install won't have things break.