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

Using swap for install #450

Open
pmaterer opened this issue Jan 10, 2025 · 2 comments
Open

Using swap for install #450

pmaterer opened this issue Jan 10, 2025 · 2 comments

Comments

@pmaterer
Copy link

I'm using nixos-anywhere to install NixOS on a machine with 1GB of memory. During the Disko phase the /nix/store runs out of space (tmpfs filesystem running in memory). So I've taken to using a larger (30GB) external disk for swap. And this works, but when it gets to the reboot phase it fails. This is because I'm configuring zpools using Disko, and nixos-anywhere runs swapoff -a if it detects zpools. I understand this was added because of #420 (@TilCreator is using swap on a zpool) which makes sense... but maybe we can add a flag to disable this behavior. This flag would be useful when you are using swap for the install and not using swap on a zpool.

@pmaterer
Copy link
Author

pmaterer commented Jan 10, 2025

For clarity, I immediately get an "Out of memory" error after swap is turned off and my zpools do not get exported.

@pmaterer
Copy link
Author

Some ideas:

  • My initial idea was to add a new nixos-anywhere flag (something like --no-swapoff). If this flag is set simply skip the swapoff -a step.
  • Somehow check if the swap devices that are on are using ZFS and only turn those off.
  • Make users label their ZFS swap devices. Then require a flag, something like --swapoff-labels. Only turn those swap devices off.

Any thoughts?

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

1 participant