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

nixos-anywhere does not export ZFS pools before rebooting #156

Open
nbraud opened this issue Jul 15, 2023 · 8 comments
Open

nixos-anywhere does not export ZFS pools before rebooting #156

nbraud opened this issue Jul 15, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@nbraud
Copy link

nbraud commented Jul 15, 2023

Describe the bug

ZFS pools are (apparently) not exported prior to reboot, and may fail to import on first boot.

To Reproduce

Steps to reproduce the behavior:

  1. Use a disko config with a ZFS pool imported during early boot, like <disko/example/zfs.nix>
  2. Set boot.zfs.forceImportRoot = false; in the NixOS config. This is “highly recommended” by NixOS' own docs
  3. Run nixos-anywhere $target

Observed behaviour

System installs successfully, reboots, then initramfs fails to import the zpool.

Expected behavior

Successful import and boot.

System information

Current nixos-anywhere HEAD (e516d37)
Target was a Lenovo x230, booted on the current NixOS minimal install image (nixos-minimal-23.05.1950.fcc147b1e93-x86_64-linux.iso)

Additional context

Things work properly when running nixos-anywhere --no-reboot and manually running zpool export -a prior to rebooting.

@nbraud nbraud added the bug Something isn't working label Jul 15, 2023
@Lassulus
Copy link
Contributor

I guess we can try to run zfs export -a everytime before the final reboot?

@nbraud
Copy link
Author

nbraud commented Jul 15, 2023

I guess we can try to run zfs export -a everytime before the final reboot?

Yes, that seems sensible to me. 👍

@Lassulus
Copy link
Contributor

#157

@Mic92
Copy link
Member

Mic92 commented Aug 5, 2023

The disko pr was applied. Can we close this?

@ethnt
Copy link

ethnt commented Aug 21, 2023

I currently still have this issue, despite that PR being merged into disko. Even with forceImportRoot set to true, I cannot import the ZFS root pool on boot.

@Mic92
Copy link
Member

Mic92 commented Aug 21, 2023

Also you only ever need forceImportRoot set to false for network-based block devices like iscsi. Otherwise your local nvme never gets accidentally used twice. iscsi was also the primary use case of this check.

@Mic92
Copy link
Member

Mic92 commented Aug 21, 2023

I currently still have this issue, despite that PR being merged into disko. Even with forceImportRoot set to true, I cannot import the ZFS root pool on boot.

That's a different issue than. Check that your hardware-configuration.nix has all required kernel modules to set up your block device driver, i.e. the nvme driver for nvme.

@phaer
Copy link
Member

phaer commented Oct 27, 2023

@nbraud Curious if #239 changes anything here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants