[Bug 274421] bectl mount does not recognize intermediate canmount=off partitions for deep boot environments

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 12 Oct 2023 02:30:37 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274421

            Bug ID: 274421
           Summary: bectl mount does not recognize intermediate
                    canmount=off partitions for deep boot environments
           Product: Base System
           Version: 14.0-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: tamaru@psc.t.u-tokyo.ac.jp

I have tested this on FreeBSD 14.0-BETA5.

Following is a sample zfs layout to describe the issue.

NAME                      canmount mountpoint
root/ROOT/default         noauto   /
root/ROOT/default/usr     off      /usr
root/ROOT/default/usr/src noauto   /usr/src
root/ROOT/default/usr/obj noauto   /usr/obj
root/home                 on       /home
root/var                  off      /var
root/var/log              on       /var/log

It is close to the "deep boot environment" as described in btctl(8),
but differs in that canmount=off for /root/ROOT/default/usr .

/etc/rc.d/zfsbe correctly mounts this BE as:

Filesystem                 Mounted on
root/ROOT/default          /
root/ROOT/default/usr/src  /usr/src
root/ROOT/default/usr/obj  /usr/obj
root/home                  /home
root/var/log               /var/log

and the contents of /usr such as /usr/bin is included in root/ROOT/default .

However, running
btctl -r root/ROOT mount default
when the system is booted from another BE or pool, it only mounts
as deep as just before the first non- canmount=off partition,
in this case root/ROOT/default only:

Filesystem                Mounted on
root/ROOT/default         /tmp/be_mount.WsGI

and differs from the preferred behavior that zfsbe gives.


When we are at this, bectl create misbehaves in this regard as well. Running
bectl create -r backup
correctly replicates the whole hierarchy, but does not honor canmount
properties.

NAME                      canmount mountpoint
root/ROOT/default         noauto   /
root/ROOT/default/usr     off      /usr
root/ROOT/default/usr/src noauto   /usr/src
root/ROOT/default/usr/obj noauto   /usr/obj
root/ROOT/backup          noauto   /
root/ROOT/backup/usr      noauto   /usr     <====
root/ROOT/backup/usr/src  noauto   /usr/src
root/ROOT/backup/usr/obj  noauto   /usr/obj
root/home                 on       /home
root/var                  off      /var
root/var/log              on       /var/log

and thus, by switching to this backup BE by
bectl activate backup
the next boot looses /usr/bin (and others) when zfsbe (correctly) mounts /usr .

-- 
You are receiving this mail because:
You are the assignee for the bug.