Leveraging LUKS to Add (Almost) Native Encryption Key Slots to ZFS
Have you ever wanted to encrypt a ZFS pool, and have the option to use multiple keys, including per-user passphrases to unlock it? For those that have used LUKS in the past, this seems like a trivial feature: simply have each user add a password to a keyslot, and add a backup key for if you forget the password or want friction-free setup when a device is connected to a trusted system, and you're off to the races. For an advanced filesystem like OpenZFS, you'd assume it'd be easy too, ...right?
Unfortunately, after a bit of documentation hunting and Googling, you'll realise that this isn't yet a feature in ZFS. In the rest of this (quite short, and more braindump than anything) post, I'll show you how to setup LUKS-like keyslots for your ZFS pools, which doesn't address the root issue but is definitely much easier than filing a PR in the openzfs
project, and means you no longer have to re-enter keys for your pools after a reboot.