git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #89353 from wizeman/u/fix-zfs-ebusy

stage-1: retry mounting ZFS root a few times

commit6a2c73031a48752e247beab5c8a297cb6c01266b authorLassulus <github@lassul.us> dateSat 22 Aug 2020, 15:42 (6 years ago) parentc0d6bcce234135
1 file changed+4−2
nixos/modules/system/boot/stage-1-init.sh+4−2
nixos/modules/system/boot/stage-1-init.sh+4−2
@@ -378,12 +378,14 @@ mountFS() {
378378
379379 mkdir -p "/mnt-root$mountPoint"
380380
381− # For CIFS mounts, retry a few times before giving up.
381+ # For ZFS and CIFS mounts, retry a few times before giving up.
382+ # We do this for ZFS as a workaround for issue NixOS/nixpkgs#25383.
382383 local n=0
383384 while true; do
384385 mount "/mnt-root$mountPoint" && break
385− if [ "$fsType" != cifs -o "$n" -ge 10 ]; then fail; break; fi
386+ if [ \( "$fsType" != cifs -a "$fsType" != zfs \) -o "$n" -ge 10 ]; then fail; break; fi
386387 echo "retrying..."
388+ sleep 1
387389 n=$((n + 1))
388390 done
389391