Skip to content

Commit d9e12a2

Browse files
Bert-ProesmansMic92
authored andcommitted
fix(zpool); Ignore shadow-mount error during recreate of zpool at existing non-empty path
1 parent d8a3e36 commit d9e12a2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/types/zpool.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,18 @@ in
365365
if [ $continue -eq 1 ]; then
366366
zpool create -f "${config.name}" \
367367
-R ${rootMountPoint} \
368+
${
369+
if
370+
(
371+
# NOTE; It might be necessary to validate the value of config.options.mountpoint too
372+
config.rootFsOptions.canmount or "" == "off"
373+
)
374+
then
375+
# Mountpoint of root(pool)-dataset could be non-empty and ZFS by default prevents shadowing mounts.
376+
"-m none"
377+
else
378+
""
379+
} \
368380
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
369381
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-O ${n}=${v}") config.rootFsOptions)} \
370382
''${topology:+ $topology}

0 commit comments

Comments
 (0)