Understanding the EFI Boot Structure
In modern systems using UEFI rather than legacy BIOS, the bootloader does not reside on the Master Boot Record (MBR). Instead, it lives on a dedicated FAT32 partition known as the EFI System Partition (ESP). When you install Linux alongside Windows 10, the installer places GRUB files into this partition, usually under a directory named/EFI/ubuntu or /EFI/redhat. Windows also stores its bootloader in /EFI/Microsoft/Boot.
The issue arises when this structure is corrupted, deleted, or overwritten. Common causes include a failed update, a manual deletion of the ESP contents, or an aggressive Windows Update that resets the boot order. Unlike legacy BIOS, where boot.ini or the MBR itself was modified, EFI relies on NVRAM variables stored in the motherboard firmware. These variables point to the specific file path on the ESP that should be executed at startup. If these pointers are lost, the system will skip straight to Windows or display a "No Boot Device Found" error.
To resolve this, you must ensure that the GRUB binaries are present on the disk and that the NVRAM variables correctly reference them. This is distinct from general software troubleshooting, which might involve registry edits or driver reinstalls. For broader context on handling Windows-specific boot issues, you may want to review our guide on Recovering Windows 10 EFI Bootloader after Installing Linux, although that focuses primarily on restoring the Microsoft side of the equation.
Preparation and Accessing Recovery Media
Before attempting any repairs, you need access to a live Linux environment. A standard Windows installation USB will not suffice because it lacks the necessary tools to manipulate the Linux filesystem and GRUB configuration. You should create a bootable USB drive using a tool like Rufus or Etcher with a recent version of Ubuntu, Fedora, or another major distribution. Once the USB is ready, insert it into your machine and reboot. Enter the UEFI setup menu by pressing the appropriate key during POST, commonly F2, F12, Del, or Esc depending on the manufacturer. Navigate to the Boot tab and disable Secure Boot temporarily if possible, as some older GRUB versions or custom kernels may fail signature verification. Select the USB drive from the list of boot devices. When the live environment loads, connect to the internet via Ethernet or Wi-Fi, as you will need to download packages. Open a terminal immediately. The first critical step is identifying your root partition and your EFI partition. Use the commandlsblk or fdisk -l to list all block devices. Look for a partition formatted as FAT32 with a size between 100MB and 512MB; this is your ESP. Note its device identifier, such as sda1 or nvme0n1p1. Similarly, identify your main Linux root partition, which will likely be ext4 or btrfs.
Mounting Partitions and Chrooting
With the partitions identified, you must mount them to make them accessible to the recovery tools. Create a temporary mount point and attach your root partition to it. For example, if your root issda2:
sudo mount /dev/sda2 /mnt
Next, mount the EFI partition. It is crucial to mount this at /mnt/boot/efi because many Linux distributions expect the EFI partition to be located there during boot. If your system uses a separate /boot directory, adjust accordingly, but /boot/efi is the standard convention for most distros:
sudo mount /dev/sda1 /mnt/boot/efi
You also need to bind the virtual filesystems so that the chroot environment has access to hardware information and processes. Run the following commands in sequence:
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
Finally, enter the chroot environment. This changes your current root directory to the mounted Linux installation, allowing you to run commands as if you were logged into the broken system:
sudo chroot /mnt
At this stage, you are effectively inside your installed Linux system. Any package manager commands you run will affect the installed OS, not the live USB.
Reinstalling GRUB and Updating Configuration
Now that you are chrooted, you can repair the bootloader. First, ensure your package lists are up to date. Depending on your distribution, useapt update for Debian/Ubuntu based systems or dnf check-update for Fedora/RHEL based systems. Then, reinstall the GRUB EFI package. On Ubuntu, this is often part of the grub-efi-amd64 package:
apt install --reinstall grub-efi-amd64 grub-common
After reinstalling, you must regenerate the GRUB configuration file. This step scans your partitions for operating systems and creates the grub.cfg file. Use the following command, replacing x with the number of your disk (not the partition):
grub-mkconfig -o /boot/grub/grub.cfg
This command writes the new configuration to the disk. However, it does not automatically update the UEFI NVRAM variables. To fix this, you need to reinstall the GRUB EFI modules directly to the ESP. Use grub-install with the target platform set to x86_64-efi:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu
The --bootloader-id flag ensures that GRUB is placed in the correct directory (/EFI/ubuntu) and registered in the NVRAM. If you are using a different distribution, change the ID to match your distro name, such as fedora or arch.
If the command fails with errors regarding missing keys or directories, verify that /boot/efi is correctly mounted and writable. Once successful, exit the chroot and unmount the partitions:
exit
sudo umount /mnt/boot/efi
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt
Remove the USB drive and reboot. Your system should now present the GRUB menu, allowing you to select between Windows 10 and Linux. If Windows still boots automatically, you may need to re-enable Secure Boot and adjust the boot priority in the UEFI settings.
For users experiencing random crashes or blue screens during this process, refer to our analysis on Windows 10 BSOD Randomly: Continues BSOD After Fresh Reinstall with Factory Drivers to rule out hardware instability.
Frequently Asked Questions
Why does Windows still boot even after installing GRUB?
The UEFI firmware prioritizes boot entries based on their position in the NVRAM variable list. Installing GRUB adds a new entry, but it may not become the default automatically. You can change the default boot option using the efibootmgr command in Linux or through the UEFI Setup utility on the motherboard.
Can I recover GRUB without a live USB?
No, you cannot recover GRUB while running Windows because Windows lacks the tools to write to the Linux partition or modify the GRUB configuration files. You must use external media containing a Linux kernel and package manager to perform the repair.
What if my EFI partition is not FAT32?
The UEFI specification strictly requires the EFI System Partition to be formatted as FAT32. If your partition is NTFS or exFAT, it is not a valid ESP. You would need to backup your data, recreate the partition as FAT32, and move the EFI files back to it before proceeding with the GRUB installation.
Does disabling Secure Boot permanently affect security?
Disabling Secure Boot allows unsigned kernels and bootloaders to load, which reduces protection against low-level malware. However, once GRUB is properly signed and registered in NVRAM, you can re-enable Secure Boot. Most modern Linux distributions support Secure Boot out of the box, so you should test enabling it after confirming GRUB works.
How do I verify that GRUB is correctly installed in NVRAM?
You can list the current boot entries by running efibootmgr -v in the chrooted environment. Look for an entry labeled ubuntu or your distro name that points to the \EFI\ubuntu\grubx64.efi file. If the entry exists but the system skips it, the boot order needs adjustment.