[EFI/UEFI/Linux] Replace a EFI boot partition

  1. Create an EFI partition on the boot disk using gdisk. Where it exists on the disk doesn’t matter. The partition should be at least 100MB but >200MB is recommended. It is critical that the partition type is Boot Partition (type ef00).
  2. Create a filesystem on that partition. It MUST be vfat type 32. A regular vfat format will not work.

mkfs.vfat -F 32 /dev/[partition]

3. Get the UUID of the partition:

blkid /dev/[partition]

4. Change the /boot/efi entry in /etc/fstab to use the 8 CHARACTER UUID (technically not a UUID) from the output of the blkid command. Do not use the standard UUID displayed.

5. Mount /dev/[partition] to /boot/efi

6. If you’re in rescue mode you’ll likely need to bring up networking to reinstall certain packages:

ifconfig [device] [ip address]

ifconfig [device] netmask [netmask]

route add default gw [gateway]

7. Populate the EFI partition by reinstalling these packages:

dnf reinstall shim-* grub2-efi-* grub2-common

The partition should now be bootable. There is no need to use grub-install or grub2-install with EFI.