Question re ZFS boot structure

Greetings all,

As per another thread, I have been testing installation of FreeBSD 11.1, which created the following zfs system:
Code:
zfs list
NAME                 USED  AVAIL  REFER  MOUNTPOINT
bootpool             128M  1.73G   128M  /bootpool
zroot                301M   219G    88K  /zroot
zroot/ROOT           299M   219G    88K  none
zroot/ROOT/default   299M   219G   299M  /
zroot/tmp             88K   219G    88K  /tmp
zroot/usr            352K   219G    88K  /usr
zroot/usr/home        88K   219G    88K  /usr/home
zroot/usr/ports       88K   219G    88K  /usr/ports
zroot/usr/src         88K   219G    88K  /usr/src
zroot/var            620K   219G    88K  /var
zroot/var/audit       88K   219G    88K  /var/audit
zroot/var/crash       88K   219G    88K  /var/crash
zroot/var/log        180K   219G   180K  /var/log
zroot/var/mail        88K   219G    88K  /var/mail
zroot/var/tmp         88K   219G    88K  /var/tmp
The system shows two possible boot locations:
Code:
zpool get bootfs
NAME      PROPERTY  VALUE               SOURCE
bootpool  bootfs    -                   default
zroot     bootfs    zroot/ROOT/default  local
but it boots from:
Code:
vi /boot/loader.conf
. . .
vfs.root.mountfrom="zfs:zroot/ROOT/default
. . .
1. What is the difference between the "default" and "local" boot source?
2. If I were to move some data-sets, e.g., the zroot/usr, zroot/usr/src so that the beadm preserves them, do I move them to zroot/ROOT/usr, zroot/ROOT/usr/src or to zroot/ROOT/default/usr, zroot/ROOT/usr/default/src?

Kindest regards,

M
 
Greetings all,

just in case someone is similarly confused, the answer to 2. is zroot/ROOT/default/usr, zroot/ROOT/usr/default/src.

Kindest regards,

M
 
but it boots from:
Code:
vi /boot/loader.conf
. . .
vfs.root.mountfrom="zfs:zroot/ROOT/default
. . .
1. What is the difference between the "default" and "local" boot source?
There is only one boot source. Both default and local only apply to those settings. The default being just that, and the other being locally changed.

Disclaimer: I'm biased in all this because I consider the automated ZFS installation to be crappy. Just want to get this out of the way, I can answer without letting my bias get the best of me though ;)

The ROOT file system is basically a placeholder and that's it. Same applies to zroot, it's one of the reasons why I don't like this setup. The reasoning behind this is fully legit though: this is done so that you can (relatively) easily switch between boot environments. So; you can create a new filesystem, for example zroot/ROOT/newboot, and then use that instead of default.

This allows you to manage several boot environments (and/or OS versions) next to each other, normally done using sysutils/beadm.

My problem with all this though is that the zroot/ROOT/default file system is therefor set up not to automatically mount itself. Something you'll quickly experience for yourself when you're booting the system using a rescue CD and you try to import (access) your ZFS pool and the ZFS filesystems. At first things will appear to be empty. See also zfs get canmount zroot/ROOT/default.

2. If I were to move some data-sets, e.g., the zroot/usr, zroot/usr/src so that the beadm preserves them, do I move them to zroot/ROOT/usr, zroot/ROOT/usr/src or to zroot/ROOT/default/usr, zroot/ROOT/usr/default/src?
It doesn't really matter all that much because the separation of your boot system should already be enough for beadm not to touch any of the other filesystems. However... this is an assumption on my part because I don't use beadm myself.

Personally I'd recommend keeping everything under zroot because it makes accessing the dataset names a whole lot easier. Example: zroot/src to access the /usr/src filesystem.

Hope this can clear things up a bit.
 
Hi ShelLuser,

thank you for your reply, which although too sophisticated for me, at least prompted me to look into the structure more closely. So if you still could indulge me and review the following, I would be grateful.

Regarding 1, you are absolutely correct that the default and the local have only one source namely the:
Code:
NAME                 USED  AVAIL  REFER  MOUNTPOINT
bootpool             128M  1.73G   128M  /bootpool
that contains a single directory /boot, which contains, inter alia, all the three boot stages. The
Code:
zroot/ROOT/default   299M   219G   299M  /
is just a link boot -> bootpool/boot.

If I understand correctly, this structure assures that, as you have written:
The reasoning behind this is fully legit though: this is done so that you can (relatively) easily switch between boot environments. So; you can create a new filesystem, for example zroot/ROOT/newboot, and then use that instead of default.
This in turn enables the function of the beadm(1). Is this understanding correct?

Regarding 2, my understanding is different from yours. Consider, by means of an example, the date-sets /usr. All the sub-directories under /usr except the explicitly declared ones /usr/home, /usr/ports, /usr/src will be replicated by the beadm(1). Thus, if one desires a different structure to be replicated by the beadm(1), the data-sets need to be renamed.

Considering that I am correct, the lack of an ability to structure the data-sets in bsdinstall(8) is disadvantageous. In the pre-UEFI days I was able to find script(s) and modify it/them to tailor the installation as I wanted, but I cannot find similar scripts for the UEFI based installation. Since you mentioned that you do not use bsdinstall(8) and tailor the installation, could you advise me how to do that? Perhaps via p.m. or e-mail since this does not appear to be of interest to many people.

Kindest regards,

M
 
Back
Top