aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTravis A. Everett <travis.a.everett@gmail.com>2021-11-04 14:09:40 -0500
committerTravis A. Everett <travis.a.everett@gmail.com>2021-11-04 14:09:40 -0500
commitabdf9f2a6ecdc364531ed1554b689a6a467b79d1 (patch)
tree5db6fc5e003c2a776bdbb8e26b0dad38e4ec1d14 /scripts
parentc4bd6a15c2171153021691776cc657872c42338c (diff)
darwin-install: fix already-mounted store volumes
This adds an explicit unmount of the store volume to avoid cases where the installer can hang in await_volume when: - the user already has a store volume - that volume is already mounted somewhere other than /nix - they do not take a path through the installer that results in an explicit unmount (as both removing and encrypting the volume would do)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create-darwin-volume.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/create-darwin-volume.sh b/scripts/create-darwin-volume.sh
index b52232dd3..334b75045 100755
--- a/scripts/create-darwin-volume.sh
+++ b/scripts/create-darwin-volume.sh
@@ -742,6 +742,9 @@ setup_volume() {
use_special="${NIX_VOLUME_USE_SPECIAL:-$(create_volume)}"
+ _sudo "to ensure the Nix volume is not mounted" \
+ /usr/sbin/diskutil unmount force "$use_special" || true # might not be mounted
+
use_uuid=${NIX_VOLUME_USE_UUID:-$(volume_uuid_from_special "$use_special")}
setup_fstab "$use_uuid"