Recover Windows Boot Loader After a Fresh Linux Install
Well, my indecisiveness has come yet again to bite me in the rear, I decided to distrohop once more, and stupidly cleared my windows boot partition yet again (when will I ever learn). Well, this time since I've done it quite a number of times am an expert at recovering it, but incase I forget am noting it down here so that I can refer to it if need be.
So the steps are as follows:
- get a windows installation media
- plug the installation media into the pc and boot into it
- click trouble shoot
- click command prompt (may need to go into "advanced options" to find this)
- enter "
bcdboot C:\windows
" - exit and reboot, windows should be back
If the above does not work, you need to do some screwing with the diskpart utility (although it is extremely trash compared to fdisk and other linux utilities, as expected)
- Follow same steps as above to get to command prompt
- enter
diskpart
- type in
list disk
- find the disk that matches your windows hard drive (to check you can enter
select disk x
and thenlist vol
to show you the partitions of that drive) - enter
sel disk x
- once you find a disk select the small FAT32 partition that is on it (should be around 100MB)
- enter
sel vol x
- enter
assign letter X:
- enter
exit
- enter
cd /d X:\efi\Microsoft\Boot\
- enter
bootrec /FixBoot
- enter
ren BCD BCD.backup
- enter
bcdboot c:\Windows /l en-us /s x: /f ALL
- exit and reboot