First post, by Leolo
- Rank
- Member
Hi people,
Today I've wasted several hours of my life thanks to Microsoft, ASUS and UEFI (in no particular order), so I'm going to explain it here to help anyone who has this same problem in the future.
I was installing a computer with an ASUS P8H61-M LX mainboard for a friend, with a 3 TB hard disk, so I decided to go with GPT to have the full capacity of the disk in one partition.
I booted WinPE and used imagex.exe to apply a standard Windows 7 wim image that I maintain updated and configured with essential software (antivirus, lav video codecs, adobe reader, etc.).
Afterwards, I executed the bcdboot.exe tool to populate the EFI ESP partition and copied the BCD database and all the folder structure to the path recommended by Microsoft:
\efi\microsoft\boot
Then I rebooted and entered the BIOS, innocently hoping that I could specify the path to the Microsoft boot manager (bootmgfw.efi).
Guess what? ASUS does not offer any option to select the path to the boot manager. I've seen this possibilty offered in other EFI mainboards, but ASUS has decided, in their infinite wisdom, that the user will not have any way of manually selecting a boot manager 🙁
So I was stuck, and started searching for a way to get the computer to boot. I found this command line that seemed very promising:
bcdedit.exe /store s:\efi\microsoft\boot\bcd /set {FWbootmgr} displayorder {Bootmgr} /addfirst
Microsoft says you can use it to update your mainboard's NVRAM boot options and set the Microsoft's boot manager as the first entry.
That's exactly what I want! So I booted into WinPE again and tried the command... but it failed 🙁
An error occurred while attempting to reference the specified entry.
The system cannot find the file specified.
I spent a great deal of time searching for an answer in google but found nothing. I saw people asking the same question, receiving either no answer or worse, useless answers.
Finally, I tried booting from an original Windows 7 CD, and selected the UEFI CD boot in the BIOS boot menu.
In the very first screen, I pressed Shift+F10 to enter a command prompt, and then tried the same command again:
bcdedit /store s:\efi\microsoft\boot\bcd /set {FWbootmgr} displayorder {Bootmgr} /addfirst
And this time it worked!! Sucess!! Yeaaah!! I could finally boot into Windows. 😀
Conclusions: the bcdedit.exe behaves differently depending on the type of boot:
If you boot WinPE using MBR code, bcdedit.exe will FAIL to update the mainboard's NVRAM.
If you boot WinPE using UEFI code, bcdedit.exe will SUCCEED updating the mainboard's NVRAM.
It seems easy and logical, but it's not mentioned anywhere in the documentation, and Microsoft doesn't warn you about this!
So, after this lenghty rant, you may be wondering: why did you mention Microsoft's disregard of standards?
Well, it seems that UEFI says you should place your boot manager in the EFI ESP partition at this location:
\EFI\boot\
And then you should name the bootmanager "bootx64.efi" or "bootx86.efi" depending on which architecture your processor has.
If Microsoft had used that location, then the ASUS mainboard would have automatically detected the boot manager, and would have presented it in the boot menu. But thanks to Microsoft's utter disregard of standards, it did not find the boot manager in the place it was looking for.
So, to make a long story short: I hate Microsoft for ignoring the standard, but I also hate ASUS for not giving the user a way to select the path manually at least!
Kind regards.