NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.06k forks source link

Feature Request: boot.loader.systemd-boot.mirroredBoots #152155

Open aidalgol opened 2 years ago

aidalgol commented 2 years ago

I am installing NixOS on ZFS mirror pool (with two disks), with an EFI partition on each disk.

Number  Start   End     Size    File system     Name     Flags
 3      1049kB  537MB   536MB   fat32           ESP      boot, esp
 1      537MB   45.1GB  44.6GB                  primary
 2      45.1GB  53.7GB  8589MB  linux-swap(v1)  primary  swap

With GRUB, I could use the boot.loader.grub.mirroredBoots option, but I would prefer to use systemd-boot, so I am manually syncing the EFI partition on disk 1 to disk 2 after making changes. It would be nice to have an equivalent to this option for systemd-boot.

lodi commented 2 years ago

This would be a great option to have. I'm in the same position as you: I have one EFI partition mounted as /boot, all the other disks mdadm'ed together in "metadata 1.0" mirror on /boot2, and then I just manually rsync /boot to /boot2 after every configuration change. Would be great for this all to be automatic.

bjornfor commented 2 years ago

[...] I just manually rsync /boot to /boot2 after every configuration change

You can convert /boot to mdadm raid after the initial install, look for "The hoops are" in https://lists.freedesktop.org/archives/systemd-devel/2017-December/039962.html. But it's not supported (and I stopped doing it).

UPDATE: A useful thread about mdadm mirror raid for /boot / ESP (and the dangers of doing it): https://github.com/systemd/systemd/issues/12468

m5x commented 2 years ago

+1 This would be really nice to have.

tolbkni commented 1 year ago

+1 This would be really nice to have.

Gerg-L commented 1 year ago

FYI, #246897

nixos-discourse commented 11 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/zfs-systemd-boot/29956/11