ZFS ZFS boot environments

Structures​


From the updated manual page for bectl(8), with regard to the -r flag for a recursive boot environment:



The traditional FreeBSD boot environment layout, as created by the Auto ZFS option to bsdinstall(8), is a shallow boot environment structure, where boot environment datasets do not have any directly subordinate datasets. Instead, they're organized off in zroot/ROOT, and they rely on datasets elsewhere in the pool having canmount set to off. For instance, a simplified pool may be laid out as such:

Code:
% zfs list -o name,canmount,mountpoint
NAME                    CANMOUNT        MOUNTPOINT
zroot
zroot/ROOT              noauto          none
zroot/ROOT/default      noauto          none
zroot/usr               off             /usr
zroot/usr/home          on              /usr/home
zroot/var               on              /var

In that example, zroot/usr has canmount set to off, thus files in /usr typically fall into the boot environment because this dataset is not mounted. zroot/usr/home is mounted, thus files in /usr/home are not in the boot environment.

The other style of boot environment in use, frequently called deep boot environment, organizes some or all of the boot environment as subordinate to the boot environment dataset. For example:

Code:
% zfs list -o name,canmount,mountpoint
NAME                            CANMOUNT        MOUNTPOINT
zroot
zroot/ROOT                      noauto          none
zroot/ROOT/default              noauto          none
zroot/ROOT/default/usr          noauto          /usr
zroot/ROOT/default/usr/local    noauto          /usr/local
zroot/var                       on              /var

Note that the subordinate datasets now have canmount set to noauto. These are more obviously a part of the boot environment, as indicated by their positioning in the layout. These subordinate datasets will be mounted by the zfsbe rc(8) script at boot time. In this example, /var is excluded from the boot environment.

bectl commands that have their own -r operate on this second, deep style of boot environment, when the -r flag is set. A future version of bectl may default to handling both styles and deprecate the various -r flags.


The update:

{link removed}

2017 discussion:

 
Last edited:
On one hand I can understand the appeal of the deep/recursive BE. It makes it easier for some people to understand "what's in a BE". Since ZFS is COW, it shouldn't be a big deal when creating new ones and upgrading etc.

On the other hand I think there needs to be a lot of thought give on install: can one mix and match? What happens if you start with shallow/traditional and then do a deep one?
 
Is it truly traditional for zroot/ROOT/default to have no mount point?



I'm accustomed to / as the point.

For example, a boot environment created (without -r) yesterday:

1648948621250.png
 
Back
Top