Merge pull request #239 from nix-community/zfs-fix

umount /mnt prior to exporting zpool
This commit is contained in:
Paul Haerle 2023-10-27 09:43:07 +00:00 committed by GitHub
commit 12d5c4dd3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -476,7 +476,9 @@ if [[ ${copy_host_keys-n} == "y" ]]; then
fi
nixos-install --no-root-passwd --no-channel-copy --system "$nixos_system"
if command -v zpool >/dev/null; then
zpool export -a || : # we always want to export the zfs pools so people can boot from it without force import
# we always want to export the zfs pools so people can boot from it without force import
umount -Rv /mnt/
zpool export -a || true
fi
# We will reboot in background so we can cleanly finish the script before the hosts go down.
# This makes integration into scripts easier