-
-
Notifications
You must be signed in to change notification settings - Fork 266
Description
Error cannot open 'root': dataset does not exist
when executing the disko unmount script on the example configuration zfs-encrypted-root.nix
.

Reproduction
- Deploy the zfs-encrypted-root.nix configuration on top of a (virtual) disk
- Use the diskoScript attribute script to format+mount
- Cleanup the disko managed mounts
- Use the unmount attribute script to unmount
- Observe error message after the
zfs unload-key
command
Expected to happen
Key for dataset zroot/root
is sucessfully unloaded IF it was previously loaded.
What happens
Command zfs unload-key root
fails because the filesystem argument is not zroot/root (poolname + dataset path).
Possible fix
I think the filesystem name argument for zfs unload-key
has to be changed to become the poolname + dataset path. AKA "${config._parent.name}/${config.name}"
?
RELATED; The zfs load-key
in the mount script is also broken probably? This flies under the radar (I guess) due to testing sequence "create" + "mount"; where "create" already does correct encryption setup.
disko/lib/types/zfs_volume.nix
Lines 91 to 100 in 67ff980
_unmount = diskoLib.mkUnmountOption { | |
inherit config options; | |
default = { | |
dev = '' | |
${lib.optionalString ( | |
config.options.keylocation or "none" != "none" | |
) "zfs unload-key ${config.name}"} | |
${config.content._unmount.dev or ""} | |
''; |
