How to Fix GRUB for UEFI Boot
In this article
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
- 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.
- Once in the live environment, open a terminal and identify your root and EFI partitions using
lsblkorsudo fdisk -l. Look for a partition with typeEFI System— usually around 100–550 MB and formatted as FAT32. - Mount your Linux root partition. Replace
/dev/sdXYwith your actual root partition (e.g.,/dev/nvme0n1p2):sudo mount /dev/sdXY /mnt - 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/efisudo mount /dev/sdXZ /mnt/boot/efi(replacesdXZwith your EFI partition, e.g.,/dev/nvme0n1p1) - Bind mount virtual filesystems so chroot works properly:
sudo mount --bind /dev /mnt/devsudo mount --bind /proc /mnt/procsudo mount --bind /sys /mnt/syssudo mount --bind /run /mnt/run(include this if your distro uses/run) - Chroot into your installed system:
sudo chroot /mnt - 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 - 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 - Exit chroot and unmount all partitions:
exitsudo umount /mnt/dev /mnt/proc /mnt/sys /mnt/run /mnt/boot/efi /mnt - 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-installwithout specifying--target=x86_64-efi— defaults to BIOS mode on some systems. - Not binding
/runin systems that require it — can cause package or GRUB operations to fail inside chroot. - Running
update-gruboutside 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-idsomething descriptive likeLinuxorMyOSfor clarity in the UEFI boot menu. - Use
efibootmgr -vafter 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/EFIbefore 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/efiand is FAT32. Useblkidto verify its filesystem type. - GRUB rescue> prompt appears: This indicates GRUB can’t find its configuration. Use
lsin rescue mode to locate the correct partition, thenset prefix=(hdX,gptY)/boot/grubandinsmod normal. Then proceed with reinstalling GRUB properly. - Chroot fails with “no such file or directory”: This often means
/proc,/sys, or/devweren’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
mountcommand.
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).