A long-running server suddenly stopped booting successfully. It started displaying a “grub rescue>” prompt after reboot. My searches suggested this meant grub needed to be reinstalled. This server uses EFI firmware so all the instructions on using “grub2-install” that I found everywhere are moot. After a couple of days of searching, this is the procedure I found that is supposed to work on a system with EFI firmware. Unfortunately, after doing this, I continued to get boot rescue> prompts after rebooting.
- Boot a Fedora Live image from USB being sure to select the UEFI boot device listing for it in the BIOS boot menu.
- Open a terminal window and do:
sudo su -mkdir /mnt/root - The root filesystem is on an LVM partition on this server, so activate all the LVMs on the system:
vgchange -a y mount /dev/mapper/fedora_fedora-root /mnt/root- Examine
/mnt/root/etc/fstabto figure out which partitions should be mounted where. Thelsblk -o name,size,mountpoint,uuidcommand can help map physical devices to fstab entries that identify partitions by their UUID.mount /dev/sda2 /mnt/root/boot
mount /dev/sda1 /mnt/root/boot/efi - Mount all the system partitions:
mount -o bind /dev /mnt/root/dev
mount -o bind /proc /mnt/root/proc
mount -o bind /sys /mnt/root/sys
mount -o bind /run /mnt/root/run
mount -o bind /sys/firmware/efi/efivars /mnt/root/sys/firmware/efi/efivars chroot /mnt/root /bin/bashdnf reinstall shim-* grub2-*grub2-mkconfig -o /boot/grub2/grub.cfg