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.
  • Loading branch information
Baughn committed Aug 16, 2016
1 parent 52a875f commit 98b213a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions nixos/modules/tasks/filesystems/zfs.nix
Expand Up @@ -247,8 +247,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 98b213a

Please sign in to comment.