Skip to content

Commit

Permalink
zpool: better error message if zpool has no assigned devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Sep 3, 2024
1 parent 736c815 commit 8f0f75f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/types/zpool.nix
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ in
in
''
readarray -t zfs_devices < <(cat "$disko_devices_dir"/zfs_${config.name})
if [ ''${#zfs_devices[@]} -eq 0 ]; then
echo "no devices found for zpool ${config.name}. Did you misspell the pool name?" >&2
exit 1
fi
# Try importing the pool without mounting anything if it exists.
# This allows us to set mounpoints.
if zpool import -N -f '${config.name}' || zpool list '${config.name}'; then
Expand Down

0 comments on commit 8f0f75f

Please sign in to comment.