I recently installed 13.2-RELEASE and, perhaps for the first time after the change of upstream source for ZFS changed, ran some long-standing scripts that cloned ZFS hierarchies. After scratching my head for a while, it appears that the
Is this a "feature" that I haven't been able to find documentation around?
To replicate, install using
Note that the
Cloning that filesystem results in it being mounted at the point in the hierarchy one would expect with the
The same occurs if the filesystem's
canmount
property is not being preserved.Is this a "feature" that I haven't been able to find documentation around?
To replicate, install using
bsdinstall
on ZFSNote that the
usr
filesystem is intentionally not mounted (it serves as an anchor for other file systems). That canmount=off
is intentional can be confirmed by examining /usr/libexec/bsdinstall/zfsboot
Code:
# Don't mount /usr so that 'base' files go to the BEROOT
/usr mountpoint=/usr,canmount=off
Cloning that filesystem results in it being mounted at the point in the hierarchy one would expect with the
mountpoint
being unspecified
Code:
[jeff@m75 ~]$ zfs get canmount,mounted zroot-m75-2023/usr
NAME PROPERTY VALUE SOURCE
zroot-m75-2023/usr canmount off local
zroot-m75-2023/usr mounted no -
[jeff@m75 ~]$ sudo zfs clone zroot-m75-2023/usr@2023-04-24 zroot-m75-2023/cloned_usr
[jeff@m75 ~]$ zfs get canmount,mounted zroot-m75-2023/cloned_usr
NAME PROPERTY VALUE SOURCE
zroot-m75-2023/cloned_usr canmount on default
zroot-m75-2023/cloned_usr mounted yes -
[jeff@m75 ~]$ freebsd-version -ku
13.2-RELEASE
13.2-RELEASE
[jeff@m75 ~]$ zfs --version
zfs-2.1.9-FreeBSD_g92e0d9d18
zfs-kmod-2.1.9-FreeBSD_g92e0d9d18
The same occurs if the filesystem's
mountpoint
is simply inherited.
Code:
[jeff@m75 ~]$ sudo zfs get mountpoint,mounted,canmount zroot-m75-2023/_jail/_base/usr
NAME PROPERTY VALUE SOURCE
zroot-m75-2023/_jail/_base/usr mountpoint /zroot-m75-2023/_jail/_base/usr inherited from zroot-m75-2023
zroot-m75-2023/_jail/_base/usr mounted no -
zroot-m75-2023/_jail/_base/usr canmount off local
[jeff@m75 ~]$ sudo zfs snapshot zroot-m75-2023/_jail/_base/usr@test
[jeff@m75 ~]$ sudo zfs clone zroot-m75-2023/_jail/_base/usr@test zroot-m75-2023/cloned_usr_test
[jeff@m75 ~]$ sudo zfs get mountpoint,mounted,canmount zroot-m75-2023/cloned_usr_test
NAME PROPERTY VALUE SOURCE
zroot-m75-2023/cloned_usr_test mountpoint /zroot-m75-2023/cloned_usr_test inherited from zroot-m75-2023
zroot-m75-2023/cloned_usr_test mounted yes -
zroot-m75-2023/cloned_usr_test canmount on default