Disko partition setup on UEFI system which has fallback boot partition?

Hey,

I have 2 nvme ssd disks available on my server which is using UEFI instead of legacy bios.

All examples I have seen contain only 1 boot partition on 1 disk or are using legacy grub based boots.

There was a longer discussion regarding this in this closed Github thread: nixos/systemd-boot: Add mirroredBoots by Gerg-L · Pull Request #246897 · NixOS/nixpkgs · GitHub but it seems that this feature was not merged after all.

I read from Encrypted ZFS mirror with mirrored boot on NixOS - Elis Hirwing that it’s not trivial to have fallback boot partitions on UEFI.

Is it possible to have “mirrored boots” with systemd and uefi? Can I still use grub based boot on uefi?

Would someone be able to point into good disko based configuration which creates these partitions and which boot.loader configs I would need to use?

Yes, you can use Grub in UEFI boot. That’s what boot.loader.grub.device = "nodev"; does. You can look through the grub options for this here: NixOS Search Note that Grub supports booting directly off ZFS but this is largely unnecessary and bug-prone (and doesn’t actually do error recovery using mirrors). Just have the one vfat partition per disk for the ESP and let NixOS install your kernels / initrds there.

I think some variation of the systemd-boot mirroedBoots PR could have been merged. It’s just tricky because the random-seed file that systemd-boot is somewhat important for security purposes and leaving it around on an easily accessible file system like the secondary drive’s ESP without changing it every boot is just a little bit worrying. And doing as much as we can to make it as atomic as possible is just… frustrating work.

2 Likes