Hi, I'd like to boot FreeBSD 12 on a system where the OS is installed to a ZFS pool that can't be booted by the OS. This is a pre-UEFI machine. It has a pair of SAS drives and 3 PCIe slots. What I'd like to do is put the boot loader on the SAS drive and then have FreeBSD load from a ZFS mirror created using 2 nvme SSD drives on PCIe to M.2 adapter cards. The BIOS is old enough that it will not boot from a PCIe card. If I create a FreeBSD-boot partition on the SAS drive and a FreeBSD-zfs partition on the ZFS mirror, will the boot partition loader automatically find the ZFS pool? If not, is there anything special I can do to force a boot? Second, if I want to do this on a second machine that does have UEFI, can I do the same thing? This time, I think would I would do is put a UEFI boot partition on the SAS drive and have it find the FreeBSD-zfs partition on the ZFS mirror. Thank you, Walter -- The greatest dangers to liberty lurk in insidious encroachment by men of zeal, well-meaning but without understanding. -- Justice Louis D. Brandeis
On Fri, Jan 11, 2019 at 3:09 PM Walter Parker <walterp at gmail.com> wrote:> Hi, > > I'd like to boot FreeBSD 12 on a system where the OS is installed to a ZFS > pool that can't be booted by the OS. > > This is a pre-UEFI machine. It has a pair of SAS drives and 3 PCIe slots. > What I'd like to do is put the boot loader on the SAS drive and then have > FreeBSD load from a ZFS mirror created using 2 nvme SSD drives on PCIe to > M.2 adapter cards. The BIOS is old enough that it will not boot from a PCIe > card. > > If I create a FreeBSD-boot partition on the SAS drive and a FreeBSD-zfs > partition on the ZFS mirror, will the boot partition loader automatically > find the ZFS pool? If not, is there anything special I can do to force a > boot? >So on older BIOS machines, there's a two stage boot process. The first stage loads gptboot off a dedicated partition (which is type FreeBSD-boot, iirc). This stage then finds the 'root' filesystem, and loads /boot/loader from that. Newer /boot/loader should have the right fallback logic to fall back to a ZFS pool properly. However, there's a catch that will trip you up: the devices with the zpool have to be presented as BIOS devices. It sounds like in your case they are not. This means you'll have to do the next best thing: You'll need a small FreeBSD UFS partition and need to pivot to the ZFS root. I've not done this, so it may be a bit of a pita, but it looks to be documented in reboot(8) and init(8). Second, if I want to do this on a second machine that does have UEFI, can I> do the same thing? This time, I think would I would do is put a UEFI boot > partition on the SAS drive and have it find the FreeBSD-zfs partition on > the ZFS mirror. >Yes. You could do that. If the RAID controller the drives are on has UEFI support, then it will be automatic. Otherwise, you'll need to fall back to the method described above. Warner
Am 11.01.2019 um 23:08 schrieb Walter Parker <walterp at gmail.com>:> If I create a FreeBSD-boot partition on the SAS drive and a FreeBSD-zfs > partition on the ZFS mirror, will the boot partition loader automatically > find the ZFS pool? If not, is there anything special I can do to force a > boot?Set up a UFS filesystem on one of the disks that the BIOS can access and put everything under /boot into it. Install boot or gptboot (not zfsboot or gptzfsboot) with gpart, since loader will only work on that UFS filesystem. Since loader can?t find your root file system (as the BIOS has no access to those disks), you need to set the path to the root filesystem in loader.conf (see loader.conf(3), vfs.root.mountfrom). For ZFS, that something like zfs:poolname/path/to/rootfs. This will instruct the kernel to mount root from that spec. Normally, loader figures this out automatically, by probing the disks for metadata (ZFS) or by analyzing fstab (UFS), but in your case, it can?t. You?ll probably want to add an entry for /boot to your fstab, so updates will update the boot partition instead of the /boot directory on your ZFS root. HTH, Stefan -- Stefan Bethke <stb at lassitu.de> Fon +49 151 14070811