Created attachment 219663 [details] Corrected version of the script. The /etc/rc.d/zfsbe script confuses ZFS dataset names with filesystem paths. As a result it doesn't recognize datasets that are children of the dataset that is mounted at "/". Instead it mounts them at the location they would be at if a different boot environment was used. This is the broken set of mounts (with other, not relevant mounts omitted): Filesystem Size Used Avail Capacity Mounted on gs1p/ROOT/FreeBSD_12.2-RELEASE 459G 391M 459G 0% / gs1p/ROOT/FreeBSD_12.2-RELEASE/usr 464G 5.5G 459G 1% /ROOT/FreeBSD_12.2-RELEASE/usr gs1p/ROOT/FreeBSD_12.2-RELEASE/usr/local 466G 7.8G 459G 2% /ROOT/FreeBSD_12.2-RELEASE/usr/local gs1p/ROOT/FreeBSD_12.2-RELEASE/usr/src 460G 1.2G 459G 0% /ROOT/FreeBSD_12.2-RELEASE/usr/src The result is a trip to the datacenter to fix the now broken upgrade.
I want to clarify that the script does not confuse dataset names and mount point names. The script assumes that for filesystems used as boot environments a mountpoint is always a default one (i.e., $mountpoint == /$ds_name). I would be helpful if you provided output of zfs list -rH -o mountpoint,name,canmount,mounted -s mountpoint -t filesystem gs1p/ROOT
/ROOT gs1p/ROOT on yes /ROOT/12.2 gs1p/ROOT/12.2 on yes /ROOT/FreeBSD_11.3-RELEASE-p2 gs1p/ROOT/FreeBSD_11.3-RELEASE-p2 noauto yes /ROOT/FreeBSD_11.3-RELEASE-p2/usr gs1p/ROOT/FreeBSD_11.3-RELEASE-p2/usr noauto yes /ROOT/FreeBSD_11.3-RELEASE-p2/usr/local gs1p/ROOT/FreeBSD_11.3-RELEASE-p2/usr/local noauto yes /ROOT/FreeBSD_11.3-RELEASE-p2/usr/src gs1p/ROOT/FreeBSD_11.3-RELEASE-p2/usr/src noauto yes /ROOT/FreeBSD_12.2-RELEASE gs1p/ROOT/FreeBSD_12.2-RELEASE on yes /ROOT/FreeBSD_12.2-RELEASE/usr gs1p/ROOT/FreeBSD_12.2-RELEASE/usr on yes /ROOT/FreeBSD_12.2-RELEASE/usr/local gs1p/ROOT/FreeBSD_12.2-RELEASE/usr/local noauto yes /ROOT/FreeBSD_12.2-RELEASE/usr/src gs1p/ROOT/FreeBSD_12.2-RELEASE/usr/src on yes In my version of the script it compares mountpoints with the boot environment's non-boot mountpoint. Which I believe will accomplish the intended purpose of only matching mountpoints that are children of the boot environment. This in turn should work in both the filesystem "/ROOT" case and the "/<poolname>/ROOT" case.
I don't object against your change. It's just that you have an unusual / non-standard layout.
It's a server that's been upgraded since 2011. I don't think we had a standard back then, and if we did I didn't know it. I don't recall seeing any documentation on what the filesystem layout was supposed to be, either. So I'm hoping our base system will be more resilient to setups that aren't quite the standard. Certainly having a boot fail isn't the best way to find out my setup isn't what one of FreeBSD's scripts expects when tools like FreeBSD's bectl have no complaints.
(In reply to Andriy Gapon from comment #1) >> I want to clarify that the script does not confuse dataset names and mount point names. >> The script assumes that for filesystems used as boot environments a mountpoint is always >>a default one (i.e., $mountpoint == /$ds_name). But it's not a case for default installation: test@localhost:~ % freebsd-version -ku ; uname -a ; zfs list -rH -o mountpoint,name,canmount,mounted -s mountpoint -t filesystem zroot/ROOT 13.2-RELEASE 13.2-RELEASE FreeBSD localhost.localdomain 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64 / zroot/ROOT/default noauto yes none zroot/ROOT on no test@localhost:~ % This is what installer from 13.2-RELEASE-disc1 created for me.
(In reply to Anton Saietskii from comment #5) BTW, comments are confusing. In the above example, zroot/ROOT/default/somedir dataset will get /somedir mountpoint, but will be matched by "*)", which says "filesystems with mountpoint elsewhere". In fact, /somedir isn't "elsewhere", but indeed relative to BE both by dataset name and mountpoint.