How can I repair the Windows 8 EFI Bootloader?
I installed Windows 7 and Windows 8 in EFI mode on a hard disk some days ago. Today, the bootloader got missing/corrupted. I currently have the Windows 8 installer on a flash drive and tried using the Automatic Repair option to repair the bootloader but it didn't do anything. The Startup Repair option is also missing in the Windows 8 installer. How I can repair/recreate the EFI bootloader from the Command Prompt?
| |||||||||||||||||
|
I've spent a lot of time trying to get my Windows 8 PC to boot again after cloning to a new SSD and try to summarise how I finally got it all working - Firstly, boot from a UEFI Windows 8 recovery disk (CD/DVD/USB) - I found that the automated recovery process didn't find the correct Windows partition, nor when I managed to add it to BCD settings would it make it reliably bootable e.g. using BCDEDIT I got it to find and launch the Windows partition but it refused to cold boot or would not "keep" the settings after a 2nd reboot or power off. Go into the Advanced options and run the Command Prompt. Enter
Then assign a drive letter to the EFI partition:
Exit DiskPart tool by entering
Delete or rename the BCD file:
Use
The Reboot and cross your fingers. This gave me headaches. I was going in circles for a long while and there. isn't a lot of reliable info about fixing UEFI/Windows 8 at the time of writing. [EDIT] To re-enable Hyper-V, I also had to run the following:
| |||||||||||||||||||||
|
The other answers are helpful but this is what I had to do to fix mine. I had a 1.5 TB hard drive with Windows 7 installed on it. I then installed Windows 8 onto a 150 GB SSD I bought. The 1.5 TB hard drive failed and I could hear it making a noise, my computer would no longer start, saying "please insert system disk". I thought that the bootloader was missing as it must have been on the 1.5 TB disk. It turns out it was but the problem then was the guides I followed would not rebuild the bootloader or whatever it is called as i did not have an EFI partition on the smaller 150 GB disk (this may have existed on the failed disk), it only had 1 partition which filled the entire disk. I did not want to lose all my data so I entered the Command Prompt by booting from my Windows 8 install USB drive (noting that you cannot boot the UEFI version of this if that appears, select to boot from the just the USB drive without the UEFI appearing before it). Once in Command Prompt (see the other answers for instructions) you need to shrink the partition. To do this, enter the following commands, pressing Enter after each one:
These commands will create the EFI partition. Double-check everything by typing Now this is done you need to copy the boot files to this newly created partition:
Note: you must replace I also entered the following commands:
These both came back successful, no idea if they really did anything but who cares. Windows is now fully recovered. | |||||
|
Windows 8 is still not out in final form, so problems are to be expected. You are in an area new to most of us, where the commands we used to use may not work anymore. To the commands listed by @soandos, I add this one that completely rebuilds the BCD :
Try also to use the Advanced boot menu from Windows 8 and let us know what happens. If nothing works, the article Repairing Windows 7 when they fail to boot has some advice on using bcdedit to correct boot errors. It would in any case be interesting to see what is the output of bcdedit on your computer. [EDIT] These links might contain some helpful ideas : Recovering the Windows Bootloader from the DVD | |||||
|
Okay, I've had time to put together a proper outline here. It's long, but it's pretty complete and should help you see what's going on. First, one way this can happen:
Here's what you've probably done by now. IF ANY OF THIS DOES NOT MATCH, CAREFULLY EVALUATE WHETHER THIS IS IN FACT YOUR PROBLEM, and READ this for ideas but don't FOLLOW it without thinking first.
If ALL of that applies fairly closely to you, here is what MAY be going on:
So here, finally, is what you need to do about it. The good news is that it's probably a lot simpler than you're hoping by now.
Actually, I have a hunch that's not strictly correct-- I strongly suspect the EFI partition is already mounted by some internal subsystem, which is why BCDEDIT gets cranky-- it doesn't see the database, but it knows where it should go. Whatever it does not have, however, is a drive letter. So-- what to do? Well...how far back do your DOS roots go? Do you remember the ASSIGN command? Guess what.
It is usually a 100MB FAT32 partition marked "SYSTEM". Keep in mind that your disk should be using a GPT partition table by now, so you may see quite a few partitions. Some of these are for emergency recovery-- fat lot of good they do for EFI problems, eh? Oh well. Notice that the EFI partition, and a few others, do not have drive letters. If you're so inclined, you can also view the GPT partition attributes, which may give you a few tangentially-related "Aha" moments as well.
And now... a big fat warning. You will probably go directly to S: (or whatever you got from ASSIGN) and notice a /Boot partition. "AHA!" You will say. "There is no BCD file here!" First... remember that file is hidden. Second... dig around a bit more, and you will notice that while there is: S:\EFI\Boot there is also: S:\EFI\Microsoft\Boot You need to check both of these for problems. S:\EFI\Boot is for the motherboard, and contains the Windows Boot LOADER (and possibly other things for other operating systems). This has this name because the motherboard has no idea if you're going to have Windows or not, and needs a fixed path that makes sense.
bootx64.efi If you have installed an EFI shell (always a good idea), you might additionally see "shellx64.efi". NOTE: Dual-boot Linux users using "chainloader+1" WILL NOT see an extra entry here.
bootmgr.efi bootmgfw.efi memtest.efi BCD BCD.Backup.001 BCD.Backup.002 ...except that you probably don't see BCD, do you? But those backup files sure look tempting.
Q: What if you don't HAVE a backup BCD? A: Well, that really shouldn't happen. It likely means you're either in the wrong directory, support EFI but weren't actually using it, or somehow rebuilt your entire EFI partition without all of the required Windows materials (possible, especially when using multiple versions of Windows). In that case, you'll need to copy the EFI materials from the DVD, then either modify or rebuild the Boot Configuration Database using BCDEDIT. Q: Can you give me an example of a scenario where "BCDEDIT /SYSSTORE" can be used to do anything at all on an EFI system? A: So far, no. Anyway, hope this helps solve some problems for people, or at least gets them thinking. As a very important final point, please note that you can mount and inspect your EFI partition under Windows normally using the DISKPART ASSIGN technique above. You should do this at least once, to get a complete backup of your EFI partition, BEFORE you run into this kind of trouble. I recommend one backup into a subdirectory on your C: drive, and one on a USB flash drive. Sorry that's so long-winded. I need to turn this into a proper article at some point, but there are so many people who are SO frustrated that I felt the need to document my experience as completely and rapidly as I could. Cheers, Matt "Breakpoint" Heck | |||||
|
The easiest way:
|
'컴퓨터관련' 카테고리의 다른 글
display port(DP) vs hdmi...펌 (0) | 2014.12.14 |
---|---|
동적디스크를 기본디스크로 바꾸는 법. diskpart, list disk, select disk 0, list partition, selection partition 1, convert basic...펌 (0) | 2014.12.03 |
복구파티션없이 uefi 부팅 윈도우 설치하기...펌 (0) | 2014.11.26 |
uefi 부트매니저 bootmgr...펌 (0) | 2014.11.26 |
[스크랩] UEFI 기반 디스크 파티션 권장 구성 (0) | 2014.11.26 |