zroot/ROOT/default, bectl(8) and boot environments (was: rationale for default ZFS datasets)

From: Graham Perrin <grahamperrin_at_freebsd.org>
Date: Sun, 17 Jul 2022 16:42:07 UTC
On 17/07/2022 17:28, Taceant Omnes wrote:
> … what is the purpose of zroot/ROOT/default? …

> root@fbsd-vm:~ # zfs list
> NAME                 USED  AVAIL     REFER  MOUNTPOINT
> zroot               4.38G  32.0G       96K  /zroot
> zroot/ROOT          3.40G  32.0G       96K  none
> zroot/ROOT/default  3.40G  32.0G     3.40G  /
> zroot/tmp           1001M  32.0G     1001M  /tmp
> zroot/usr            508K  32.0G       96K  /usr
> zroot/usr/home       220K  32.0G      148K  /usr/home
> zroot/usr/ports       96K  32.0G       96K  /usr/ports
> zroot/usr/src         96K  32.0G       96K  /usr/src
> zroot/var           1.02M  32.0G       96K  /var
> zroot/var/audit       96K  32.0G       96K  /var/audit
> zroot/var/crash       96K  32.0G       96K  /var/crash
> zroot/var/log        540K  32.0G      540K  /var/log
> zroot/var/mail       124K  32.0G      124K  /var/mail
> zroot/var/tmp         96K  32.0G       96K  /var/tmp

Consider the output from two commands:

zpool get bootfs zroot

zfs get mountpoint zroot/ROOT/default

If you find that the mountpoint is none, you might wonder about / in 
your listing above. This part of the magic of ZFS boot environments.

------------------------------------------------------------------------

Here, for example:

% zpool get bootfs august
NAME    PROPERTY  VALUE                              SOURCE
august  bootfs    august/ROOT/n256570-5c19fabbe34-e  local
% zfs get mountpoint august/ROOT/n256570-5c19fabbe34-e
NAME                               PROPERTY    VALUE       SOURCE
august/ROOT/n256570-5c19fabbe34-e  mountpoint  none        inherited 
from august
% bectl list -c creation
BE                        Active Mountpoint Space Created
n250511-5f73b3338ee-d     -      -          64.6G 2021-11-13 15:43
n253776-d5ad1713cc3-b     -      -          9.43G 2022-03-18 09:31
n254693-d7696096209-f     -      -          4.60G 2022-04-27 17:41
n255078-e140d551b78-h     -      -          88.4G 2022-05-11 21:18
n255588-01235012e5b-d     -      -          2.61G 2022-05-15 00:29
n255588-01235012e5b-b-c1d -      -          14.0G 2022-05-23 18:11
n255769-f16e38162c7-k     -      -          6.48G 2022-06-14 20:36
n256147-1c665e95d44-d     -      -          6.35G 2022-06-25 08:08
n256363-9c42645a1e4-d     -      -          3.32G 2022-07-05 19:40
n256570-5c19fabbe34-c     -      -          3.66M 2022-07-13 10:53
n256570-5c19fabbe34-d     -      -          80.8M 2022-07-16 08:00
n256570-5c19fabbe34-e     NR     /          61.9G 2022-07-17 12:09
%

See bectl(8) 
<https://www.freebsd.org/cgi/man.cgi?query=bectl&sektion=8&manpath=FreeBSD>