Skip to content

Commit

Permalink
zfs: Keep trying root import until it works
Browse files Browse the repository at this point in the history
Works around #11003.

(cherry picked from commit 98b213a)

Reason: several people cannot boot with ZFS on NVMe
  • Loading branch information
Baughn authored and wizeman committed Aug 18, 2016
1 parent 81a8ce8 commit 5688c39
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions nixos/modules/tasks/filesystems/zfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,19 @@ in
esac
done
''] ++ (map (pool: ''
echo "importing root ZFS pool \"${pool}\"..."
zpool import -d ${cfgZfs.devNodes} -N $ZFS_FORCE "${pool}"
echo -n "importing root ZFS pool \"${pool}\"..."
trial=0
until msg="$(zpool import -d ${cfgZfs.devNodes} -N $ZFS_FORCE '${pool}' 2>&1)"; do
sleep 0.25
echo -n .
trial=$(($trial + 1))
if [[ $trial -eq 60 ]]; then
echo
echo "$msg"
break
fi
done
echo
'') rootPools));
};

Expand Down

0 comments on commit 5688c39

Please sign in to comment.