From d9e12a2c7fc44d08381ca5314d15718d71956fa4 Mon Sep 17 00:00:00 2001 From: Bert Proesmans Date: Sun, 2 Nov 2025 14:54:29 +0000 Subject: [PATCH] fix(zpool); Ignore shadow-mount error during recreate of zpool at existing non-empty path --- lib/types/zpool.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/types/zpool.nix b/lib/types/zpool.nix index 2f4530d..f240ebc 100644 --- a/lib/types/zpool.nix +++ b/lib/types/zpool.nix @@ -365,6 +365,18 @@ in if [ $continue -eq 1 ]; then zpool create -f "${config.name}" \ -R ${rootMountPoint} \ + ${ + if + ( + # NOTE; It might be necessary to validate the value of config.options.mountpoint too + config.rootFsOptions.canmount or "" == "off" + ) + then + # Mountpoint of root(pool)-dataset could be non-empty and ZFS by default prevents shadowing mounts. + "-m none" + else + "" + } \ ${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \ ${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-O ${n}=${v}") config.rootFsOptions)} \ ''${topology:+ $topology}