DISCLAIMER = YES I am aware that there are probably guides on this around the Internet. However I am writing this from my own knowledge. So please no posts like.. oh you got it from here or there THANK YOU Kindly... :)
So I am pretty sure this works on 7/8/8.. Confirmed not working 10.x.. Different efi structure
@Kai -- Kai you may find this helpful when you screw a dual boot up :D
@MisteryAngel -- You may find this helpful when you finally go ahead and install to your HDD sometime
WORKING ASSURANCE: How do I know this works... Well go ahead and ask me. I have screwed up windows partitions more than a few bakers dozens of times.. haha... This is how I restore in a pinch provided your original windows partition is okay. SO without further adue lets get started
WINDOWS USERS BE NOT AFRAID TO TRY LINUX NOW
So you ruined your windows bootloader attempting linux eh...? Well lets get that back without reinstalling everything.. HAHA
Alright here we go. Follow these steps as I say. Some steps will require your Unique input and Ill let you know when those are
- Boot in EFI mode into your windows install disk
- Run the following commands which may or may not be different for you .. YOU MAY ALSO USE YOUR FAVORITE PARTITION MANAGER for this task (deleting the two small bootloader partitions)
diskpart
list disk
select disk 0 (your windows disk)
select partition 1 (this should be the 100 mb part)
delete partition override
select partition 2 (this should be the 128 mb part)
delete partition override
exit
- Now go ahead and proceed with these commands. This is what we will do to create the 2 lost/screwed up boot partitions (PLEASE DONT TYPE IN WHAT I WROTE IN PARANTHESIS.. That was for your reference)
diskpart
list disk
select disk 0 #Select the desired disk
create partition efi size=100
list partition
select partition 1 (or whatever the newly created partition's number is)
format quick fs=fat32 label="System"
assign letter=A (Try B if A doesnt work ;) )
create partition msr size=128
list partition (Make sure both partitions are created without errors
list vol
select vol 3 (Use the number corresponding to your windows installation)
assign letter=C
exit
5. Lets move those EFI files over now so we can begin to restore our boot loader
mkdir A:\EFI\Microsoft\Boot
xcopy /s C:\Windows\Boot\EFI*.* A:\EFI\Microsoft\Boot
6. Now its time to use our handy dandy friend. BCD EDIT
a:
cd EFI\Microsoft\Boot
bcdedit /createstore BCD
bcdedit /store BCD /create {bootmgr} /d “Windows Boot Manager”
bcdedit /store BCD /create /d “Windows 7” /application osloader
(THIS WILL RETURN {A Unique String} Refered to as {UNIQUE} Later :D pay attention)
bcdedit /store BCD /set {bootmgr} default {UNIQUE}
bcdedit /store BCD /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw.efi
bcdedit /store BCD /set {bootmgr} displayorder {default}
(NOW IT IS NO LONGER BOOT MANAGER change bootmgr to default :D )
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
exit
Restart... If you find you have 2 bootable flagged drives (WONT BOOT).. then go into Gparted and removed the Boot flag from partition 2 (the msr reserved partition) (128mb large)
If it still wont boot.. maybe grub isnt updated if that is where your pointing to the windows bootloader from so try configuring the boot priority the UEFI/EFI/BIOS so that the boot partition is at the highest priority for testing purposes :D.
If you receive the error output of
“Reboot and select proper boot device or insert boot media in selected”
Then go ahead and do this... sounds strange but it has led to success for me in the past :D
Shut your PC off.. Unplug all sata power connectors to your HDD... Boot up.. wait for that screen to show that there isnt a device.. shut your computer off... Plug HDD's back in try again
IF IT STILL DOESNT WORK
Reset CMOS via Clear CMOS jumper.. Then this should work. If it doesnt repeat the restore process and try again
Happy Bootloader Restoring... This is @R00tz31820 Signing off
:D