Restoring GRUB After Windows: UEFI and BIOS Recovery

After a Windows installation or major update, a dual-boot computer may start Windows immediately instead of displaying the GRUB menu used to choose Linux. It is tempting to assume Windows erased Linux, but that conclusion is often wrong. On a modern UEFI system, Windows Boot Manager may simply have moved ahead of the Linux boot entry in firmware order. On an older BIOS system, the boot code in the disk’s boot area may have changed. In other cases, the firmware entry still points to GRUB but the files it needs are missing or the Linux filesystem is no longer available.

Those situations require different repairs. The safest recovery starts by finding out which boot path the computer uses, whether Linux is still present, and what actually fails when the machine starts. Only after that investigation should anyone reinstall GRUB or change boot entries. The procedure below focuses on distinguishing UEFI and legacy BIOS problems so a routine boot-order issue does not turn into a destructive disk operation.

First determine whether GRUB is missing or merely not selected

On a UEFI computer, the firmware can store multiple boot entries. Windows Boot Manager and a Linux entry—often labeled “ubuntu” on Ubuntu installations—may coexist on the same EFI System Partition or on separate devices. If Windows becomes the first entry, the computer can bypass GRUB without removing the Linux files. Look for a one-time boot menu during startup, usually invoked by a manufacturer-specific key. If the Linux entry is present and works, the quickest repair may be to restore that entry to the preferred position in the firmware setup.

Check the options carefully rather than assuming a missing menu means the operating system is gone. An installation that used to boot both systems might start Linux if the user chooses the Linux entry from the firmware menu. If so, make an inventory of the existing boot entries and partitions before changing anything. Reinstalling a bootloader to the wrong disk could create an unnecessary second problem.

If the Linux option is not listed, or selecting it produces a GRUB prompt, rescue shell, or firmware error, the problem may be a missing boot entry, an unreadable EFI file, an incorrect path, or a filesystem issue. Distinguish these before using repair commands. If the Windows partition or Linux partition is not detected at all, focus first on storage visibility and the integrity of the underlying disk.

Protect recovery options before modifying boot configuration

Confirm that important data is backed up and that a tested recovery path exists. The user should be able to boot installation or rescue media and access the Linux system if the attempted repair does not work. If Windows uses BitLocker or device encryption, ensure the recovery key is available before changing boot configuration, firmware settings, Secure Boot configuration, or disk layout. Changes to measured startup state can trigger a recovery prompt even when no data has been lost.

Use a rescue USB that supports the machine’s architecture and boot mode. For UEFI recovery, boot the rescue medium in UEFI mode; starting it in legacy compatibility mode can lead to confusing errors when managing EFI variables or installing an EFI bootloader. In a live Ubuntu terminal, a quick check is:

if [ -d /sys/firmware/efi ]; then echo UEFI; else echo BIOS; fi

This command reports how the current environment booted. A live USB started in BIOS mode does not prove that the installed Linux system originally used BIOS. Compare the result with the system’s historical configuration and the disk layout. Do not proceed with an EFI repair while the recovery environment is booted in the wrong mode.

Before mounting or modifying anything, collect basic read-only information:

lsblk -f
sudo parted -l

Read the output rather than copying drive numbers from an online example. SATA, NVMe, RAID, LVM, encrypted volumes, and removable storage all produce different paths. An EFI System Partition is usually formatted FAT32, but a FAT32 partition is not automatically the correct ESP for the installed Linux system. An ext4, Btrfs, or other Linux filesystem may contain the root installation; an encrypted container or logical volume may hide it until unlocked or activated.

On UEFI systems, inspect firmware entries before reinstalling

When the rescue session is booted in UEFI mode, the following command lists current firmware boot entries:

sudo efibootmgr -v

Look for the boot order and entries that refer to Windows Boot Manager and to the Linux distribution. The output may reveal that the Linux entry exists but is placed after Windows, or that it points to an EFI file on a device which is no longer present. Changing the boot order through firmware setup is often simpler and lower risk than editing EFI variables manually. If the operating system’s boot files are intact, this may be the only repair needed.

On Ubuntu installations with Secure Boot enabled, the signed shim and GRUB components form part of the verified startup sequence. A generic instruction to disable Secure Boot or replace signed files with arbitrary binaries is not an appropriate default repair. If the issue began after a firmware change, first inspect the Secure Boot state, existing boot entry, and relevant signed boot packages. Restore the expected boot path rather than dismantling the security controls as an initial troubleshooting step.

UEFI mode also changes what a GRUB installation command means. Unlike legacy BIOS installations, installing GRUB for UEFI requires a correctly mounted EFI System Partition. Pointing a BIOS-style example at an arbitrary whole disk is not the right method for an EFI installation. When in doubt, stop and identify the existing ESP and installed system mount points before going further.

Repair the installed Ubuntu system from a live session

If the boot entry is missing or its GRUB files are damaged, a live environment can provide a way to repair the installed system. The objective is to mount the existing Linux root filesystem and, if used, its separate boot and EFI partitions; then work inside that installation rather than accidentally configuring the live USB. This requires more care on encrypted, RAID, Btrfs-subvolume, or multi-disk layouts, where a short generic command sequence is often incomplete.

For a straightforward unencrypted installation, begin by locating the Linux root partition in the output of lsblk -f. Mount it at a temporary mount point. Use an explicit path that has been verified from your own output; do not run an example such as /dev/sda2 or /dev/nvme0n1p2 just because it appears in a guide. After mounting, confirm that the root contains normal directories such as etc, usr, and var, and inspect its etc/fstab for the expected UUIDs and mount layout.

If the installation has a separate /boot partition, mount it at the corresponding location inside the mounted root. For UEFI installations, mount the correct EFI System Partition at the installed system’s expected EFI directory, commonly /boot/efi. Check that the ESP contains an EFI directory and that existing vendor entries make sense. The goal is to restore the original operating system’s structure, not to format or recreate a partition.

Experienced administrators can then bind required runtime filesystems into the mounted root and enter it with chroot, which makes GRUB utilities operate on the installed system. Ubuntu’s GRUB recovery documentation explains the general technique. A chroot is not a substitute for identifying the correct root partition, and mounting the wrong directory will make subsequent commands target the wrong installation. If mounting produces unexplained filesystem errors, switch to storage diagnosis before continuing.

Once inside the correctly mounted installed environment, an EFI GRUB reinstall should use the installed distribution’s supported GRUB tooling with the correct ESP mounted. A legacy BIOS reinstall instead targets the confirmed boot disk, not an arbitrary partition. In either case, update-grub rebuilds Ubuntu’s GRUB menu from the installed system’s configuration and detected kernels. It is a different operation from grub-install, which places or updates the bootloader itself. Running one command is not a substitute for the other when both the executable boot path and generated menu need repair.

Legacy BIOS repairs follow a different disk-level path

Older systems can rely on BIOS firmware and disk boot code rather than UEFI NVRAM entries. After Windows takes control of the legacy boot sequence, restoring GRUB may require installing its boot code to the appropriate boot disk. The conventional Ubuntu and GNU GRUB documentation show grub-install directed at a whole disk device. That disk must be selected from the actual boot arrangement, and a partition path must not be substituted without a specifically justified configuration.

A BIOS installation on a GPT disk can also depend on a small BIOS boot partition, which is different from a UEFI System Partition. A system with multiple internal drives may boot from a different disk than the one holding the Linux root filesystem. Those differences explain why a command copied from an older tutorial sometimes appears to run but does not fix startup. Determine firmware mode, disk order, and partitioning scheme before installing anything.

If Linux still boots through a temporary firmware selection or rescue mechanism, it may be possible to reinstall GRUB from the working installation rather than using a live session. That avoids some chroot complexity but does not remove the need to verify the target device. After any bootloader installation, regenerate the menu if appropriate and confirm the machine can start both operating systems through the intended route.

When Linux boots but Windows is missing from the menu

A missing Windows option in GRUB is a different problem from GRUB being unavailable. Start by confirming that Windows remains bootable from the UEFI boot menu and that its partitions and EFI boot files still exist. If it does, the immediate problem is menu discovery or configuration, not necessarily a damaged Windows installation.

GRUB menu generation depends on the Linux distribution and its boot configuration. Some installations do not automatically probe for other operating systems. Review the distribution’s current guidance before changing os-prober settings, and only do so after confirming that Windows can still boot on its own. If the menu uses a default hidden timeout, the Windows entry may also be present but not visible without showing the menu. Distinguishing a hidden menu from a missing entry saves unnecessary reinstalls.

Do not try to fix this condition by reformatting the EFI System Partition, reinstalling Windows, or changing partition flags without a documented diagnosis. Such changes may remove working boot files or interrupt other firmware entries. The appropriate objective is to reconcile the menu with the actual bootable systems, not to erase the boot configuration and start again.

Verify the result and retain a recovery path

A successful repair is more than seeing GRUB once. Restart normally and verify that the intended default operating system boots, that the alternative operating system can be selected, and that the expected filesystems are mounted. If Windows encryption was involved, check that the system returns to its normal protected startup without repeated recovery-key prompts. If Secure Boot is required, confirm it remains enabled and functional.

Record the firmware mode, relevant partition UUIDs, EFI System Partition location, boot entries, boot order, and commands actually used. Retain a working rescue USB and tested backups until the system has restarted cleanly more than once. For a machine that changes boot behavior after every major update, document whether the problem is a recurring firmware-order reset or a genuinely damaged bootloader; the permanent corrective action depends on that distinction.

The central principle is simple: treat missing GRUB as a boot-path diagnosis, not as permission to run a universal reinstall command. Modern UEFI systems, legacy BIOS installations, encrypted machines, and multi-drive setups can display nearly identical symptoms for very different reasons. Inspect the existing operating systems and firmware state first, change only what the evidence requires, and verify that both Windows and Linux remain recoverable.

img