ZFS Mountpoints on zfs send target dataset(s)

During the recovery of a BEADM test gone horribly wrong I created a copy of the zpool on that host. This was carried out using zfs send to another host.

Code:
zfs send -R zroot@vhost04_RCVY2 | ssh 192.168.216.45 zfs receive zroot/vhost04_RCVY2

Now I notice on the target host this situation with respect to the mountpoint of this dataset: zroot/vhost04_RCVY2:

Code:
zfs list -r zroot/vhost04_RCVY2
NAME                                                    USED  AVAIL  REFER  MOUNTPOINT
zroot/vhost04_RCVY2                                     434G  12.2T   128K  none
zroot/vhost04_RCVY2/ROOT                               94.6G  12.2T   128K  none
zroot/vhost04_RCVY2/ROOT/12.1-RELEASE-pkgupgrade       2.54M  12.2T  42.2G  none
zroot/vhost04_RCVY2/ROOT/default                       94.6G  12.2T  42.2G  /tmp/v4root
zroot/vhost04_RCVY2/tmp                                 871M  12.2T   320K  /tmp
zroot/vhost04_RCVY2/usr                                57.1G  12.2T   128K  /usr
zroot/vhost04_RCVY2/usr/home                           55.0G  12.2T  45.8G  /usr/home
zroot/vhost04_RCVY2/usr/ports                          2.05G  12.2T  1.07G  /usr/ports
zroot/vhost04_RCVY2/usr/src                             209K  12.2T   128K  /usr/src
zroot/vhost04_RCVY2/var                                 735M  12.2T   128K  /var
zroot/vhost04_RCVY2/var/audit                           128K  12.2T   128K  /var/audit
zroot/vhost04_RCVY2/var/crash                           128K  12.2T   128K  /var/crash
zroot/vhost04_RCVY2/var/log                            14.8M  12.2T  12.7M  /var/log
zroot/vhost04_RCVY2/var/mail                            244K  12.2T   163K  /var/mail
zroot/vhost04_RCVY2/var/tmp                             719M  12.2T   719M  /var/tmp

This to me looks like a disaster waiting for the next reboot to happen. Why are the children of zroot/vhost04_RCVY2 not showing mountpoints under /tmp/v4root?
 
This to me looks like a disaster waiting for the next reboot to happen.

Yes. If You look thru the forum, there are a couple of posts concerning this, and occasionally the desaster has already happened.

Why are the children of zroot/vhost04_RCVY2 not showing mountpoints under /tmp/v4root?

I don't think zfs send/recv can do that. With the -R switch the options are literally copied, so You will get the same mountpoints as on the origin.
There may be some option for zpool import (but that would concern an entire pool).

In Your case, I suggest You fix the thing up before desaster strikes. If this was a one-time action, either change the mountpoint attributes appropriately, or set canmount=off (that is not inherited, so you have to do it for every fileset).
If You intend to do these send/recv more often, then add a file into /etc/rc.d that takes care of that before mounting. (I posted mine as an example somewhere here.)

Why are the children of zroot/vhost04_RCVY2 not showing mountpoints under /tmp/v4root?

I suppose this is the root-on-zfs thing. (I don't use that, my root stays on ufs.)
The children of zroot/vhost04_RCVY2 might inherit the mountpoint from zroot/vhost04_RCVY2 (unless configured otherwise), but as you can see from the listing, zroot/vhost04_RCVY2 itself does not have any mountpoint. Only zroot/vhost04_RCVY2/ROOT/default has it, and this is an end-leaf and so of no concern to ZFS.
 
Back
Top