bootupd icon indicating copy to clipboard operation
bootupd copied to clipboard

Support updating multiple EFIs in mirrored setups

Open jlebon opened this issue 4 years ago • 4 comments

Follow-up to https://github.com/coreos/bootupd/pull/127 (specifically https://github.com/coreos/bootupd/pull/127#discussion_r546995248). We need to update the EFI in all the devices matching the appropriate GUID, not just the one which wins the /dev/disk/by-partlabel/EFI-SYSTEM race.

jlebon avatar Jan 06 '21 19:01 jlebon

One small correction: in the mirrored boot disk case, no partitions are labeled EFI-SYSTEM.

bgilbert avatar Jan 07 '21 02:01 bgilbert

Note that just dumbly doing a type GUID match will not work for things like multipath. We solved this in rdcore by looking for ESPs only on the same devices which back the boot partition: https://github.com/coreos/coreos-installer/blob/78e2a7a4bf8d9ddb90b5e4fb5729a2550999ad11/src/blockdev.rs#L880-L945

Would probably make sense for bootupd to use the same heuristic (or if it finds a better heuristic to use, update coreos-installer to match).

jlebon avatar Dec 02 '21 14:12 jlebon

Notes for implementing this for Fedora CoreOS:

  • https://github.com/coreos/fedora-coreos-tracker/issues/1485#issuecomment-1533350911
  • https://github.com/coreos/fedora-coreos-tracker/issues/1752#issuecomment-2194950462

But unfortunately we might have to add more heuristics to support Anaconda installations.

travier avatar Jun 27 '24 16:06 travier

As far as I could see when trying various RAID setups in Anaconda (https://docs.fedoraproject.org/en-US/fedora/f36/install-guide/install/Installing_Using_Anaconda/#sect-installation-gui-manual-partitioning-swraid), they only create a single EFI system partition.

So Fedora CoreOS should be the only case with one per disk, unless someone use manual partitioning and explicitly set up two.

See also: https://gitlab.com/fedora/ostree/sig/-/issues/1#note_2086744541

travier avatar Sep 02 '24 18:09 travier

Test failed with multiple EFIs in mirrored setups (using latest bootupd in copr build):

$ cosa run --add-disk 10G -B ../ign/mirror.bu --qemu-firmware uefi -m 4096
[root@cosa-devsh ~]# mount -o remount,rw /boot
[root@cosa-devsh ~]# mv /boot/bootupd-state.json .
[root@cosa-devsh ~]# bootupctl adopt-and-update
Running as unit: bootupd.service
lsblk: : not a block device
error: Failed to run lsblk

mirror.bu is refered to doc

variant: fcos
version: 1.5.0
boot_device:
  mirror:
    devices:
      - /dev/vda
      - /dev/vdb

HuijingHei avatar Sep 26 '24 08:09 HuijingHei