mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 21:13:28 +01: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:
1 parent
e8ef4773dd
commit
115311bc39
1 file changed
+3
-1
+3
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user