| Hey, I'm experiencing an issue with postMountHook. I have a zfs pool that looks roughly like this:
{
type = "zpool";
options = {
ashift = "12";
};
rootFsOptions = {
acltype = "posix";
compression = "on";
mountpoint = "none";
overlay = "off";
xattr = "sa";
};
datasets =
let
mkDataset = lib.attrsets.recursiveUpdate {
type = "zfs_fs";
};
in
{
"rootfs" = mkDataset {
mountpoint = "/";
};
"home" = mkDataset {
mountpoint = "/home";
};
"home/user" = mkDataset {
name = "home/${config.custom.username}";
mountpoint = "/home/${config.custom.username}";
options = {
mountpoint = "/home/${config.custom.username}";
encryption = "on";
keyformat = "passphrase";
keylocation = "prompt";
"com.sun:auto-snapshot" = "true";
};
postMountHook = ''
# ...
'';
};
};
}
(other datasets omitted for the sake of brevity)
Initially I did not specify options.mountpoint, and ran into the problem that my dataset was not mounted by the time postMountHook got executed. I saw the zfs example in the disko repo using both mountpoint and options.mountpoint, so I figured I'd give it a shot. Now the problem is that it remains mounted when the main disko script tries to mount the rest, which then fails because /mnt is not empty... The error message:
+ findmnt nixos/rootfs /mnt/
+ mount nixos/rootfs /mnt/ -o X-mount.mkdir -o defaults -o zfsutil -t zfs
zfs_mount_at() failed: directory is not empty+ rm -rf /tmp/tmp.aSJMo4rNbE
I don't know if I'm doing something wrong or if the script generation is just broken?
|