Q:

zfs - two pools with nested mountpoints and conflicting mount order

I have a problem with automounting separate pools, that have nested mountpoints. I am using ZfsOnLinux 0.6.2.
The siuation currently is as follows:
zpool1      ---> /var
zpool1/log  ---> /var/log
zpool1/mail ---> /var/mail

Now I need to add a separate zpool for db. To keep directory hierarchy consistent, I thought about this:
zpool2      ---> /var/db

Now, the problem is that when zpool2 is mounted first, zpool1 fails to mount (this is logical).
Is there a way I can force the mount order of pools to allow mounting of zpool2 inside zpool1, besides using the legacy mount option? Something like zpools dependency? Or should I avoid such nested mounts at all costs?

A:

Instead of mounting zpool2 as /var/db, mount it as /zpool2 or /db or whatever makes sense for you.
Then make /var/db a symlink to /db.

A:

You can set the file system mountpoint properties to legacy and use /etc/fstab to define them.
That way, you'll be able to define the order in which they will be mounted.
Edit: I just noticed you already considered the legacy approach. It might be the only one though.

