Tips about root mirroring

I wanted to boot my FreeBSD server from a mirror, but I wanted to mirror both ZFS pool and the EFI partition.

So I performed this kind of configuration:
Code:
# gpart create -s gpt nvd0
# gpart create -s nvd1
# gpart add -t efi -s 200M nvd0
# gpart add -t efi -s 200M nvd1
# gpart add -t freebsd-zfs nvd0
# gpart add -t freebsd-zfs nvd1
# kldload geom_mirror
# gmirror label -v gm0 nvd0p1 nvd1p1
# newfs_msdos -F32 /dev/mirror/gm0
# zpool create rpool mirror /dev/nvd0p2 /dev/nvd1p2
[... classic manual FreeBSD installation ...]

The system is booting fine, but since I don't have any experience with GEOM mirror, I'd like to ask you if configuring gmirror for EFI alongside ZFS mirroring for the root pool is something reliable, or if there is a more smart method to achieve the same result.

Thank you
 
This forum is for howto guides not to ask questions about how to do things.

You can't mirror the EFI. The UEFI/BIOS doesn't have recognize and doesn't load gmirror so it can have only option to boot from single disk /file or if there's hardware Raid controller it can boot from it where it can have the mirror option.

It's enough to have copy of the ESP partition on both disk so if one of them die your system will still boot from the other disk.

So you can install the entire system normally it will create for you both ESP partitions on the both disks and during the install you have to select ZFS mirror and select both nvd0 and nvd1. After you complete the installation mount the ESP partition from nvd1 format as FAT32 and copy the loader.efi as /EFI/BOOT/BOOTx64.efi
 
Back
Top