So basically, I’m adding a new smaller pool and I want to keep the directory structure the same.
Can I do this?
zpool1 → /media/media
zpool2 → /media/media/Videos
I read that zpool won’t mount on boot because if the mount order is wrong, like if zpool2 mounts first, then zpool1 cannot mount. And there’s no way to specify the zpool mount order unless I change to legacy mode.
The articles I’ve read were a few years old, so I wanted to check if anything’s changed. Should I just do legacy mount and add them on fstab? Thoughts? Suggestions?
this depends a lot on the init system of the distro (or linux/freebsd/[…])
systemd have a mount point generator (my ubuntu 20.04-lts root-on-zfs system uses it)
not sure if it can do mount in specific order, but since it can do pretty much, i would not be surprised if i can do that too.
imports can manually be specified in order,
which at least in theory should make the order become correct.
on the alpine linux root-on-zfs installs i use legacy since it uses OpenRC as init system.
in case you do not modify the layout often, i would just run with legacy mount,
do it once and it will work until they ditch fstab…
in-case you create datasets like once a week you maybe should invest the time in systemd mounting
In addition to what Bjorn said (which lays it out quite nicely), theres something I’d like to clarify.
When the parent dataset isn’t mounted, and the nested mount is attempted, it will error out because the directory to mount it at doesn’t exist. It won’t be reattempted when the parent is mounted, unless you make it a legacy mount with automount options.
In the comments its been mentioned to use a symlink. I think this would my try as well. Create the second pool, organize and manage datasets as you like and just link it from the parent pool. No mucking around with nested mounts that might behave eratically.