Back to home
Restore windows not booting Windows can use EFI to boot the systems. Although it seems to be a stable system, things can go wrong. This is not particular to windows, but windows is trickier to restore compared to other boot managers.
The method presented here will restore windows 10 in a bootable state, but will remove any multiboot options you might have on the system, so beware!
Before you start. The below procedure it intended if all else fails. It will destroy data, but will keep your windows partition unmolested (in sofar this partition is not damaged already...)
Take care to follow things as they are described!
Also, some items may be skipped, depending on the current state of the harddisk. Just rebuilding your BDC might be enough already.
Get a bootable image First you will need some way of booting into windows. Linux or other OS's will not do because you need a windows bootloader.
This usually is the CD-ROM or USB you used to initially install windows. If you do not have one, you can create an installation media for windows 10 here.
Boot with your image After booting the install image, you will be presented with the option to select the language etc.
Here, hit shift+F10 on your keyboard, and a command prompt will be opened.
If this does not work for any reason, try to select the country, and in the next screen select 'repair your computer'. Depending on the windows version, there is an option to go to advanced options where a command prompt option is available also.
Check your disk partitions. For EFI to work, you will need a particular layout of your harddisk partitions, else EFI will not be able to work.
The standard layout for a disk with just one OS on it is:

All 3 partitions need to be available. Also, EFI only works with GPT partitioning, it will not work with the old MBR.

To check your current disk, we use diskpart in the command prompt that was opened earlier:
Diskpart, check harddisk partitioning (anything that is preceded by -- you should type, all other text is an example of what you should see)
--diskpart
		
Microsoft DiskPart version 10.0.14393.0

Copyright (C) 1999-2013 Microsoft Corporation.
On computer: DESKTOP-TJJLTAJ

DISKPART>
--list disk

 Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          111 GB      0 B

--select disk 0
--list partitions

 Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Reserved          128MB    101MB
  Partition 2    Primary           9GB      229MB
	
Now you see we have 1 disk with 2 partitions, but we should have 3. Even if there are 3 partitions, they might be damaged (corrupted files, corrupted filesystem, etc.). Since this was a system that windows was installed on, there is space reserved for the EFI boot and MSR partitions. If not, this would be the time to make an image of the operating system partition, because then the whole disk has to be altered..

Without explaining too much, here are the commands you use to restore a valid EFI boot disk:
Diskpart, restoring broken bootdisk (anything that is preceded by # you do not type.)
 	
# select the reserved partition and delete it. Do NOT delete the primary (windows) partition here!!
# based on the previous overview, we have to re-create the EFI partition.. and to make sure, we also re-create a new MSR partition:
Select partition 1
delete partition override

# now, only the primary partition should be left, verify:
list partitions

# now, create a new EFI partition, format it as FAT32
select disk 0
create partition efi size=100
list partition
 
# select the correct partition number!!
select partition 1
format quick fs=fat32 label="System"
assign letter=G

# create MSR partition
create partition msr size=128

# check
list partition
list vol

# if the windows system volume does not have a driveletter assigned, do this here. Asuming that this is volume 1 (volume 0 will be te EFI volume)
select vol 1
assign letter=C

# all done
exit
		
At this point, we are back in the command prompt we started.
Restoring EFI boot Once you have recreated the partitions, it's time to restore the EFI boot files needed:
Restoring EFI bootfiles
 	
# you should see a prompt like: X:\Sources>
mkdir G:\EFI\Microsoft\Boot
xcopy /s C:\Windows\boot\efi\*.* G:\EFI\Microsoft\Boot

#if you are asked to overwrite anything, choose Y
		
recreate the bootloaded (BCD)
 	
# you should see a prompt like: X:\Sources>
g:
cd efi\microsoft\boot
bcdedit /createstore BCD
bcdedit /store BCD /create {bootmgr} /d "Windows Boot Manager"
bcdedit /store BCD /create /d "Windows X" /application osloader

# you can replace "Windows X" with something you like
# that last command returned a GUID. use this GUID in the place of {GUID}, including the { and } !

# now, set the default boot for the bootmanager
bcdedit /store BCD /set {bootmgr} default {GUID}
bcdedit /store BCD /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw.efi
bcdedit /store BCD /set {bootmgr} displayorder {default}

# now, we set up the {default} context:
bcdedit /store BCD /set {default} device partition=c:
bcdedit /store BCD /set {default} osdevice partition=c:
bcdedit /store BCD /set {default} path \Windows\System32\winload.efi
bcdedit /store BCD /set {default} systemroot \Windows

		
Now, all that is left is to reboot the PC. Most will pick up the new EFI boot right away. Some will not.
if not, shut down the pc and remove the drive, then reboot the machine. It will complain about not being able to boot anything. Then, shut it down again, attach the harddisk and boot.
Some older BIOS's even need to be told where the new EFI partition is..
Restoring complete drive It is possible to restore a complete drive using an image of your windows install. The procedure is the same but with the added action that you will have to add the NTFS volume for your system on the drive.
After this, you can restore the image on that partition and things should work.