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

umount /mnt prior to exporting zpool #239

Merged
merged 3 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/howtos/use-without-flakes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

While `nixos-anywhere` is designed to work optimally with Nix Flakes, it also
supports the traditional approach without flakes. This document outlines how to
use `nixos-anywhere` without relying on flakes.
You will need to [import the disko nixos module](https://github.com/nix-community/disko/blob/master/docs/HowTo.md#installing-nixos-module) in your NixOS configuration
and define disko devices as described in the [examples](https://github.com/nix-community/disko/tree/master/example).
use `nixos-anywhere` without relying on flakes. You will need to
[import the disko nixos module](https://github.com/nix-community/disko/blob/master/docs/HowTo.md#installing-nixos-module)
in your NixOS configuration and define disko devices as described in the
[examples](https://github.com/nix-community/disko/tree/master/example).

## Generate Required Store Paths

Expand Down
4 changes: 3 additions & 1 deletion src/nixos-anywhere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down