Unmount everything under /mnt before zpool export, not just chroot dirs #43

Merged
beatzaplenty merged 1 commits from worktree-baremetal-esp-unmount into main 2026-07-22 04:30:06 +00:00
Owner

Follow-up to #42, which only unmounted /mnt/dev,proc,sys,run. disko also mounts the ESP at /mnt/boot (modules/disko/baremetal.nix), which is another nested mount blocking ZFS from unmounting its own root dataset at /mnt the same way -- confirmed live, zpool export still failed with 'cannot unmount /mnt: pool or dataset busy' even with the chroot-dirs-only fix in place.

Replaces the manual dev/proc/sys/run enumeration with a single recursive 'umount -R /mnt', which clears everything currently nested under /mnt (including /mnt/boot) in one shot, instead of needing to keep chasing whatever nixos-install/disko happen to leave mounted.

Verified with bash -n and scripts/codex-maintenance.sh (clean, only pre-existing documented secret-grep exceptions).

Follow-up to #42, which only unmounted /mnt/dev,proc,sys,run. disko also mounts the ESP at /mnt/boot (modules/disko/baremetal.nix), which is another nested mount blocking ZFS from unmounting its own root dataset at /mnt the same way -- confirmed live, zpool export still failed with 'cannot unmount /mnt: pool or dataset busy' even with the chroot-dirs-only fix in place. Replaces the manual dev/proc/sys/run enumeration with a single recursive 'umount -R /mnt', which clears everything currently nested under /mnt (including /mnt/boot) in one shot, instead of needing to keep chasing whatever nixos-install/disko happen to leave mounted. Verified with bash -n and scripts/codex-maintenance.sh (clean, only pre-existing documented secret-grep exceptions).
beatzaplenty added 1 commit 2026-07-22 04:23:52 +00:00
Unmount everything under /mnt before zpool export, not just the chroot dirs
Check NixOS configurations / eval-hosts (pull_request) Successful in 10m28s
619324589a
The previous fix (#42) only unmounted /mnt/{dev,proc,sys,run}, but disko
also mounts the ESP at /mnt/boot (modules/disko/baremetal.nix) -- another
nested mount blocking ZFS from unmounting its own root dataset at /mnt
the same way. Confirmed live: zpool export still failed with "cannot
unmount '/mnt': pool or dataset busy" after the chroot-only fix.

Replace the manual dev/proc/sys/run list with a single recursive
`umount -R /mnt`, which clears everything nested under /mnt -- current
and future mountpoints alike -- rather than needing to keep enumerating
whatever nixos-install/disko happen to leave mounted.
beatzaplenty merged commit eef4b05254 into main 2026-07-22 04:30:06 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No labels
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: beatzaplenty/nixos#43