mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00:00
zfs: try to import zpool in incremental mode
if the pool is not imported, zfs list will return a value. So to check that the pool does not exist, we also import it. fixes https://github.com/nix-community/disko/issues/690
This commit is contained in:
parent
e8ef4773dd
commit
115311bc39
1 changed files with 3 additions and 1 deletions
|
@ -62,7 +62,9 @@
|
|||
inherit config options;
|
||||
default = ''
|
||||
readarray -t zfs_devices < <(cat "$disko_devices_dir"/zfs_${config.name})
|
||||
if zpool list '${config.name}'; then
|
||||
# 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
|
||||
echo "not creating zpool ${config.name} as a pool with that name already exists" >&2
|
||||
else
|
||||
continue=1
|
||||
|
|
Loading…
Reference in a new issue