Grub no longer detected my Windows installation
Posted on 2025-12-25T20:01Z.
Christmas Eve 2025. It’s late at night and I should really go to bed because Santa is coming tonight. I’m installing a new hard drive in my computer to replace my existing Fedora Linux drive. The new one is larger and faster, and I decide to start from scratch with a new Fedora 43 KDE Plasma Desktop Edition installation. After the system is installed (super-fast!) I copy data over from my old drive into my new one. Mostly the home directory and a few other bits. Grub is showing me the kernels for the new OS installation, as well as options to boot several kernels from the previous drive, Windows and the UEFI Firmware Settings option.
Prior to unplugging the o…
Grub no longer detected my Windows installation
Posted on 2025-12-25T20:01Z.
Christmas Eve 2025. It’s late at night and I should really go to bed because Santa is coming tonight. I’m installing a new hard drive in my computer to replace my existing Fedora Linux drive. The new one is larger and faster, and I decide to start from scratch with a new Fedora 43 KDE Plasma Desktop Edition installation. After the system is installed (super-fast!) I copy data over from my old drive into my new one. Mostly the home directory and a few other bits. Grub is showing me the kernels for the new OS installation, as well as options to boot several kernels from the previous drive, Windows and the UEFI Firmware Settings option.
Prior to unplugging the old drive that I’m not going to use anymore, I wipe its contents with zeros. I regenerate the Grub boot entries and reboot, hoping that the entries from the old drive would no longer be present, but I immediately notice something weird. The computer now boots directly to the new Fedora installation. Maybe I missed the Grub menu because I was distracted? I reboot, mash the Escape key repeatedly and it finally shows up. Multiple options are present, including UEFI Firmware Settings, but no trace of the Windows boot option. From Linux, I can still see the Windows drive and even mount its contents, but I have no way of booting into that. Why?
The problem is a misconception I had about what happens when you have separate drives for each OS. In the BIOS days, Windows would install a boot loader into the “header” of its own partition, as well as the disk’s MBR after installation. Linux would install Grub to the MBR of its own disk and detect the Windows installation in the other drive, allowing you to chain-load the Windows boot loader from its partition. If you suddenly were to unplug the Linux disk, you could still boot from the Windows disk.
With UEFI, it’s not like that. UEFI systems typically have an active or main EFI partition in one of the drives, and that’s the one used to boot the system. The Windows installer places files in the existing EFI partition to allow you to boot Windows, and Grub or, more accurately, the tooling around it, is able to see those and add a Windows boot option. If you only have Windows installed, probably in a computer with a single disk, the EFI partition is also in the Windows disk. But if you have Linux installed on one drive, which contains the EFI partition, and you decide to reinstall Windows, Windows will place its boot loader files into the EFI partition of the Linux drive. That’s what happened to me. The Linux installation was older, because I had recently reinstalled Windows when I switched from an NVIDIA to an AMD GPU. Thus, the EFI partition was in the old Linux drive and Windows had put its boot loader files there. When I plugged in my new drive and installed Fedora from scratch on it, the installer created a new EFI partition in that disk to make it a bootable drive, but the installer and OS prober were nice enough to detect the previous EFI partition in the old drive, and allowed me to boot the old Linux installation, as well as Windows. However, after I cleared the old drive, I accidentally erased the Windows boot loader files in addition to the old Linux entries.
The hardest part of the solution was identifying and understanding the situation. fdisk -l prints only one entry labeled EFI System, it’s mounted somewhere, and there is no Microsoft directory to be found in it.
Once that was clear, the solution was not hard because the Internet has multiple blog posts describing what to do in these cases. I found the guide from Github user meroupatate to be super-clear and helpful. Summarizing the main steps:
Download a Windows ISO from Microsoft.
Create a bootable USB drive with it using woeusb.
Boot from it, press Shift+F10 on the main screen to open a command-line window.
Run the diskpart tool.
While in it, use list disk to locate the drive containing the Windows installation, and use select disk N to select it.
Use list volume to list its partitions and locate the main one containing the Windows installation, taking note of the drive letter currently assigned to it.
Exit the tool and use bcdboot X:\Windows where X is the drive letter you found in the previous step.
That will install the Windows boot loader back to the current EFI boot partition, preparing it to boot the chosen Windows installation. Then, you should be able to boot into Linux, regenerate the Grub configuration file and entries again, and that should restore the option to boot Windows.