This morning I updated my SCALE machine from 25.10.1 to 25.10.3. I downloaded the config backup including the secret key, and everything seemed OK after the update. However, I just realized that one of my encrypted datasets is now “locked”, and the key isn’t in the backup!
The configuration backup I downloaded before the update is a tar file containing freenas-v1.db and pwenc_secret. I naively tried uploading the latter as the keyfile, but that didn’t work. Some LLM-assisted troubleshooting got me this far:
$ sqlite3 freenas-v1.db ".headers on" ".mode column" "SELECT * FROM storage_encrypteddataset;"
id name encryption_key kmip_uid
-- ----------------- ---------------------------- --------
10 lime-pool/Private [redacted]
11 lime-pool/Shared [redacted]
13 lime-pool/home [redacted]
15 lime-pool/Backups [redacted]
19 lime-pool/Media [redacted]
That accounts for all of my encrypted datasets, except for the now-locked one (lime-pool/Pictures) which doesn’t appear. That would make sense to see in my live system’s database, but this was exported back when the dataset was in fact unlocked, which means the Truenas still had the key. Could the key be stored somewhere else? Maybe kept in memory, never written to disk?
On the live system, here are a couple investigative zfs queries:
# zfs get encryption,keyformat,keylocation lime-pool/Pictures
NAME PROPERTY VALUE SOURCE
lime-pool/Pictures encryption aes-256-gcm -
lime-pool/Pictures keyformat hex -
lime-pool/Pictures keylocation prompt local
# zfs get keystatus lime-pool/Pictures
NAME PROPERTY VALUE SOURCE
lime-pool/Pictures keystatus unavailable -
The only difference between the above and an “Unlocked” dataset is that keystatus is available.
This problem dataset is the most-recently-created of all my encrypted datasets; I did some reorganizing a few months ago and split these files out of a different dataset. Or, maybe it was a zfs rename operation? I can’t remember. I’m pretty sure I at least power-cycled the system once or twice since that point, but this was probably the first system update since then.
I know that all my encrypted datasets were set up with the default encryption settings. That makes it really odd that just one of them has bugged out like this! It also means that they all have key-files, not passphrases. I really wish I had downloaded all those keyfiles and put them in my password manager, but that’s hindsight; I assumed the backup tarfile would be enough.
I am holding out hope that the missing key is in that db file somewhere. If not, it looks like I basically hit myself with a ransomware attack! Any help is welcome.