[Facts] boot chain for UEFI and ZFS

posted in: computer | 0

boot -chain example with UEFI (=sucessor of BIOS):

 

UEFI … the pc is powered on and the UEFI begins with self-test routines
↓
HDD
(configured in UEFI)
… UEFI boots from the configured device (e.g. “1st boot device = HDD”)
↓
GPT

(sector 1-33)

 … UEFI reads the GPT of the device and the partition with the bootme-flag is further loaded
↓
GPT-Partition 1

with bootme-flag

(part.-type: freebsd-boot)

(sector: e.g. 34-1058)

… includes the zfs-bootloader (=gptzfsboot) and this loader searches for zpool’s with enabled bootfs-property (the first found zpool with this property is choosen)
↓
ZPOOL

(bootfs = zroot)

(part.-type: freebsd-zfs)

…  the further boot continues from the zfs, which is set as bootfs (e.g. “zroot”)
↓
ZFS

(root filesystem with

FreeBSD installation)

… the zfs-bootloader reads the zfs and loads the kernel
↓
Kernel

(FreeBSD)

… read configuration, load modules, initilialize devices (etc cetera)
↓
init / rc.d
… read configuration, configure devices, start daemons (etc cetera)

 

 

some useful commands:

#install the protected-mbr (=pmbr) into the first sector (=mbr) of the device /dev/ada0
gpart bootcode -b /boot/pmbr /dev/ada0

#install the zfs-bootloader (=gptzfsboot) into partition 1 of the device /dev/ada0
gpart bootcode -p /boot/gptzfsboot -i 1 /dev/ada0

 

if there are any errors in my explanations, please don’t hesitate to contact me.