How to restore windows 10 boot after Microsoft folder has been deleted from the EFI partition?
I had to resize my EFI partition and formated it, it deleted the Microsoft folder in it and I am no longer able to boot on windows 10. I'd like to restore the boot ability on windows 10.
I went into the recovery mode command line in the windows 10 disk and typed bootrec /rebuildbcd
it found my windows 10 install and said the reconstruction was successful, however I can't boot on the entry it creates in the efi boot menu (nothing happens when I select it). Any idea on how to repair windows 10 boot ?
Solution 1:
You CANNOT fix a EFI boot with /fixmbr
. That will screw up your GPT disk and return it to MBR two different beasts.
To fix EFI boot load your Windows USB using the function key to get to setup menu click allow EFI USB.
A box comes up wanting to upgrade click NO.
The Windows install window then comes up, click NEXT Repair Computer > Troubleshoot... > Advanced > Command Prompt
At the command prompt:
diskpart
list disk /* rem with a USB and HDD you will only have two selections
sel disk 0
list vol
sel vol /* rem look for SYSTEM FAT32 hidden ~100 MB mine was sel vol 3 yours maybe different
format fs=fat32 quick label=(optional)
list vol /*rem look for and remember which Volume Windows is C or D ?
exit
/* then...
bcdboot C:\Windows
Now here if it hangs up after a minute hit CTRL
+ c
. (I don't know why it does this sometimes but you will get a message boot files successfully created and it will boot just fine into Windows.)
exit
Click on Turn Off Computer, Remove USB and restart.
Solution 2:
(This is an update on knotheu's excellent answer.)
An EFI boot must be repaired with the proper tool. (The mostly-legacy MBR-BIOS disk setups would use the fixmbr
tool.)
To fix an EFI boot either boot into the Windows Recovery Environment by:
- using the UEFI-defined function key too boot the Win RE partition (if your computer has one)
- using a USB recovery drive to boot Win RE (hopefully the reader had the foreknowledge to create this) [additionally an UEFI setting may have to be edited to allow a USB device boot priority]
When Win RE has booted, get to the command prompt by something akin to: Troubleshoot… → Advanced Options → Command Prompt. From there:
diskpart # disk-partition editor/formatter…
list disk
select disk [0-9] # the EFI System partition is usually on disk 0
list partition
sel partition [0-9] # the EFI _System_ partition is usually the first [1]
detail partition # details if formatted, healthy, _System_ partition
! the next command nullifies any current data on the partition !
I had to do this because my partition showed RAW, `chkdsk` lacked success,
zero files were on it; though this method did work for me to restore
Windows booting, I would recommend try to fix the boot partition first.
format fs=fat32 quick label=System
list vol # disk label "Windows" to determine disk letter
exit
With the System partition formatted and the knowledge of the Windows directory disk letter, the next step is to copy the the boot files to the EFI System partition and I believe the NVRAM gets updated:
mountvol S: /S # the System partition mount to S:
bcdboot c:\windows /s s: /f UEFI /v # `bcdboot c:\windows` may be enough
/s for mountpoint, /f for firmwaretype
/v for verbose
exit # then rm USB is used, reboot