Fixing Linux Dualboot: Reinstalling the Windows EFI Bootloader Files
Posted on in Tricks • 257 words • 2 minute read
Note to my future self :).
Reloading my Linux install after a pretty radical ‘nuke and pave’ I had to get my Windows dualboot back to work. There are a thousand guides on how to do that, but I’ll add another one in case your setup is similar to mine.
I have installed windows on a separate drive and Linux on my main drive, along with the efi partition.
Don’t follow this guide blindly. Think about every step you take, because you can seriously mess up your system :).
With that out of the way, the things you have to do are:
- Boot a windows install medium.
- Choose your language and enter the ‘repair options’.
- Go to advanced and select ‘command line’.
- To mount the efi partition type diskpart and in diskpart then type
list volume. A list of volumes will be printed and one of them the
efi partition (usually around 500mb ). Select this partition
(select volume
[number]
) and assign a drive letter (X
is the drive letter you assign). - Check where your windows partition is mounted. The diskpart list
volume output will probably include it. I will assume that it is
volume
C
. Exit diskart withexit
. - To finally install the boot files type the command
bcdboot c:\windows /s x:
. This will generate boot files based onc:\windows
and install them on the partition with the letterX
.
Thats it, you can reboot now. You may have to reconfigure grub (or whatever loader you use). On arch-linux, make sure you have os-prober installed :).