If you're using pseudo roots, do you have anything at all under the root dataset other than your pseduo-root one? Freenas doesn't auto create/manage anything that you can't change to the pseudo-root instead? For example iocage or anything along those lines?
Optionally the hidden
.system (System Dataset) and
iocage (for Jails.) Other than that, nothing directly lives under my top-level root dataset except for individual pseudo-roots, and everything else nested under each one. For example:
- mainpool <--- this only serves as a place-holder, "pool identity", and determinant for .system's and iocage's inherited properties
- .system
- iocage
- zrootdata1 <--- I will recursively send this to a destination/backup pool, which will place it directly under the other pool's "real" top-level root dataset*
- archives
- documents
- downloads
- homes
- legal
- multimedia
- zrootdata2 <--- I will recursively send this to a destination/backup pool, which will place it directly under the other pool's "real" top-level root dataset*
- isos
- plexmedia
- nextclouddata
- zrootdata3
* I use the -d flag for my recv options.
The above example is color-coded to reflect inherited encryption. Datasets of the same color share the same encryption properties (same cipher, same key width, same passphrase/keystring), and unlocking the respective "encryptionroot" (
mainpool,
zrootdata1,
zdootdata2,
zrootdata3) automatically decrypts its children.
I take it there's no way to do a restore that includes the root dataset from the backup too, since you've to make the destination pool with at least the root dataset in advance?
That's one of the reasons why I decided to try out my idea of using pseudo-roots, and why I wish I had done so
earlier. Since apparently there's no such thing as a newly created zpool
without an automatically created top-level root dataset
of the same name.

In my ideal world, creating a zpool would result with a truly "empty" zpool: no datasets, not even a top-level root dataset. After which point, any datasets created at the top-level would each be their own root dataset, since there wouldn't be a mandatory top-level root dataset that uses the same name as the pool, which requires everything else to live underneath. Using my pseudo-roots, I get around this issue, and honestly managing my datasets feels more modular.

In my example above,
zrootdata1 and
zrootdata2 have higher priority, and can be treated differently, as well as sent to different remote pools. Perhaps
zrootdata3 is lower priority, so I never replicate it anywhere, since I don't care if I lose it.
I wish TrueNAS prompted where you want to
nest .system and
iocage, as perhaps I would place them under a fourth pseudo-root, who knows? I think it would make for more interesting modular control.
I suppose unlocking root + pseduo dataset on boot via a pass isn't that much more effort than unlocking just one. Certainly preferable to having to unlock several datasets all off root. A way to multi-select then unlock in one go would have solved that problem though :)
You can have the true root unlock at boot by using a keyfile/keystring instead of a passphrase. This will also allow
.system and
iocage to live under it. Make sure to save the .json of the pool's keystrings somewhere safe if you ever need to provide them in the future.
Unless you're referring to the backup pools where you send your pseudo-roots? In that case, you don't need to unlock anything, not even the backup pool's top-level root dataset, if you're sending a raw (-w) encrypted stream to the destination. My backup pool's top-level root dataset is using the same 64-character HEX string as my main pool's root dataset, for the sake of my own convenience. I can either copy + paste the same keystring, or load the
backup-pool_keystrings.json file if I need to unlock the backup pool's root dataset.
I proposed the idea of "unlock groups" before, but it wouldn't work with the underlying ZFS implementations.
One follow up question. If you have two child datasets under the pseudo root, then they'd be unlocked when the pseudo root parent is, if they share the same key or pass?
Bingo! See my above color-coded example. Datasets that share the same color are part of the same "encryptionroot" group. Unlocking the highest level in this group (e.g,
zdataroot1) unlocks all similarly-colored children.
What happens if one child dataset was restored from a pool that used a different key or pass? I assume it would have to be unlocked on its own then. Is there anyway to get it to start auto-unlocking with the pseudo root by changing the pass/key used on it to the same as the pseudo root?
You simply change its encryption properties to "Inherit". This will automatically do it for you. However, they must currently be unlocked to do this.
Manually using the same keystring or passphrase will not do it. While they "technically" may be unlocked with the same passphrase, they are treated as being residents of different encryptionroots; hence must be unlocked separately. By checking "Inherit" under the encryption properties, it's all done automatically, and simply unlocking the "encryptionroot" will unlock the rest.
In my above example, the following are all the "encryptionroots" that live on the pool. Notice the pattern:
- mainpool
- zrootdata1
- zrootdata2
- zrootdata3
The other datasets (such as
archives,
documents,
isos, etc) will not have an "unlock" or "lock" option. Only the "encryptionroots" do. However, for some reason, TrueNAS
does not allow you to manually re-lock a dataset that uses a keystring (instead of a passphrase), until you disconnect the entire pool.