TechBuzzPro

How to Fix GRUB for UEFI Boot

· 4 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can fix GRUB on a UEFI system by reinstalling it from a live environment, ensuring the EFI partition is correctly mounted and using the proper boot mode. This restores the bootloader so your Linux system can start normally after updates, dual-boot changes, or disk reconfiguration.

What You'll Need

  • A Linux live USB (such as Ubuntu, Fedora, or any distro with chroot support)
  • Internet access (for package downloads during repair)
  • Access to a terminal in the live environment
  • Basic knowledge of command-line tools like lsblk, mount, and chroot
  • UEFI-enabled boot medium (your live USB must boot in UEFI mode, not BIOS/legacy)

Step-by-Step

  1. Insert your Linux live USB and boot from it. Make sure the system boots in UEFI mode — check your firmware settings if unsure. If the live system starts in BIOS mode, it won’t properly repair UEFI GRUB.
  2. Once in the live environment, open a terminal and identify your root and EFI partitions using lsblk or sudo fdisk -l. Look for a partition with type EFI System — usually around 100–550 MB and formatted as FAT32.
  3. Mount your Linux root partition. Replace /dev/sdXY with your actual root partition (e.g., /dev/nvme0n1p2):
    sudo mount /dev/sdXY /mnt
  4. Mount the EFI System Partition (ESP) to /mnt/boot/efi. If your system uses that path, create the directory first:
    sudo mkdir -p /mnt/boot/efi
    sudo mount /dev/sdXZ /mnt/boot/efi (replace sdXZ with your EFI partition, e.g., /dev/nvme0n1p1)
  5. Bind mount virtual filesystems so chroot works properly:
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys
    sudo mount --bind /run /mnt/run (include this if your distro uses /run)
  6. Chroot into your installed system:
    sudo chroot /mnt
  7. Reinstall GRUB to the EFI partition using your distribution’s method. For Debian/Ubuntu and derivatives:
    grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
    For Fedora/RHEL/CentOS:
    grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
    For Arch Linux:
    grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
  8. Update the GRUB configuration file:
    Debian/Ubuntu: update-grub
    Fedora/RHEL: grub2-mkconfig -o /boot/grub2/grub.cfg
    Arch: grub-mkconfig -o /boot/grub/grub.cfg
  9. Exit chroot and unmount all partitions:
    exit
    sudo umount /mnt/dev /mnt/proc /mnt/sys /mnt/run /mnt/boot/efi /mnt
  10. Reboot. Remove the live USB and let the system boot normally. GRUB should now appear and allow OS selection.

Common Mistakes

  • Booting the live USB in BIOS mode instead of UEFI — this prevents correct ESP access and GRUB installation.
  • Forgetting to mount the EFI partition — GRUB cannot write bootloader files without it.
  • Using grub-install without specifying --target=x86_64-efi — defaults to BIOS mode on some systems.
  • Not binding /run in systems that require it — can cause package or GRUB operations to fail inside chroot.
  • Running update-grub outside chroot — updates the live system’s GRUB, not the installed one.

Tips

  • Verify UEFI boot by checking for /sys/firmware/efi — if it exists, you’re in UEFI mode.
  • Name the --bootloader-id something descriptive like Linux or MyOS for clarity in the UEFI boot menu.
  • Use efibootmgr -v after repair to confirm the GRUB entry is registered in UEFI firmware.
  • If dual-booting Windows, ensure Windows is not hibernated — it can lock the EFI partition.
  • Keep a backup of /boot/efi/EFI before repair in case files are accidentally deleted.

Troubleshooting

If GRUB still doesn’t appear after following the steps:

  • System boots directly to Windows or firmware: Enter your UEFI settings and check the boot order. Ensure the entry for GRUB (e.g., “GRUB” or “Linux”) is enabled and prioritized.
  • “File not found” or “invalid EFI path”: Confirm the EFI partition is mounted at /boot/efi and is FAT32. Use blkid to verify its filesystem type.
  • GRUB rescue> prompt appears: This indicates GRUB can’t find its configuration. Use ls in rescue mode to locate the correct partition, then set prefix=(hdX,gptY)/boot/grub and insmod normal. Then proceed with reinstalling GRUB properly.
  • Chroot fails with “no such file or directory”: This often means /proc, /sys, or /dev weren’t mounted. Repeat step 5 carefully.
  • After reboot, same issue persists: Double-check that the live USB booted in UEFI mode. Re-run the process and confirm each mount point with mount command.

Frequently Asked Questions

Do I need to disable Secure Boot?

No, most modern Linux distributions support Secure Boot. GRUB can be reinstalled without disabling it, though some distros require signed bootloaders.

Can I fix GRUB without a live USB?

Only if you have another working Linux system on the same machine. Otherwise, a live USB is necessary to access and repair the installation.

Why does GRUB break after a Windows update?

Windows updates can reset the UEFI boot order or overwrite the bootloader. Reinstalling GRUB as described restores it.

Should I reinstall GRUB to /dev/sda or the EFI partition?

Use the EFI partition path in --efi-directory, but target the whole disk (e.g., /dev/sda) in grub-install. The command handles the rest.

Can this method fix dual-boot issues?

Yes, once GRUB is restored, it should detect other operating systems, including Windows, during update-grub.

What if my EFI partition is full?

A full EFI partition prevents GRUB updates. Boot into a live system and clean unnecessary .efi files under /boot/efi/EFI/, keeping only essential ones (e.g., ubuntu, Microsoft).