Introduction
I bought a second hand replacement laptop for a mis-behaving Surface Pro 4 (jittery screen) and to save my time (the computer wasn’t mine) I decided to image it. Anyway, long story short, after I restored 82GB of data on the target laptop (HP 830 G5), I tried to boot it but got a HP bios error stating something like no operating system found, please reinstall the operating system.
So I booted from some usb based Windows installation media and checked the partitions, all the data was there, Windows was there, it all looked good but obviously the boot loader was broken.
I googled and found the following suggestions.
Bootrec /fixmbr
Bootrec /fixboot (Note: If this fails with access denied try BOOTSECT /NT60 SYS and then issue the command again)
Bootrec /scanos
Bootrec /rebuildbcd
The problem however, is that after issuing Bootrec /rebuildbcd it stated
“Total identified Windows installations: 0”
which of course, didn’t leave me feeling super confident that this would work. The value should be 1 at a minimum.
Another quick google and the advice out there all stated something like the following…
bcdedit /export C:\BCD_Backup C: cd boot
But that gave me the following error
“The system cannot find the path specified”
because there was no C:\boot folder. This folder doesn’t exist as this computer (Windows 10) is UEFI based and not legacy based as I guess the gazillion guides out there assumed.
Due to the format change (legacy versus UEFI) this computer uses an EFI partition to store the boot files, but that partition doesn’t have a drive letter and the path to the BCD is different to all the guides out there, so how do you fix that ?
To find the efi partition, boot from the Windows installation disc, and select Install. Next click on Repair your computer then select ->Advanced Options ->Troubleshoot ->Command Prompt.
Once done, launch diskpart and then select the disk on your computer (most likely disk 0) like so
diskpart sel disk 0 list vol
that will show you the partitions on your computer. Then I selected each of the two SYSTEM partitions, and assigned a drive letter to them so I could view the files on them using
sel vol x (where x is the volume number) assign
After assigning a drive letter and exiting diskpart I could browse that drive and view the files on it. I did this a few times to identify the correct drive, after I was done with that drive I removed the drive letter using
remove
Once I identified the EFI partition I navigated to where the bcd files were located, and that path was D:\EFI\Microsoft\Boot as shown below, note your EFI partition may end up on a different drive letter using the ASSIGN command.
Now that I found the BCD, shown above, I removed the SYSTEM, READ ONLY and HIDDEN attributes from it before renaming it to bcd.old and then rebuilt the BCD.
attrib bcd -s -h -r ren bcd bcd.old bootrec /RebuildBcd
And that was it , all I had to do before rebooting was to un-assign the drive letter using the remove command.
and finally, reboot the computer cleanly using
wpeutil reboot
I hope you found this useful, if you do please leave a comment and share this with others
cheers
niall
Thank you so much! I searched all over the internet for a guide that actually worked and finally found yours.
I’d like to highlight that this line right here seems to have made all of the difference: Bootrec /fixboot (Note: If this fails with access denied try BOOTSECT /NT60 SYS and then issue the command again). If like me you overlooked this part, the odds are good that the changes won’t stick.
thanks !
I second porsche95turbo
Very helpful guide. Thank you.
thanks Ed !
I wished I had came across your post earlier. I spent countless hours to fix my bcd but your guide just resolved all issues I was facing which all guides were Legacy based, but didn’t mention clearly.
I’m happy it helped ! thanks for posting
I have followed the steps found the bcd renamed it and applied rebuild command but still get the same error: 0 windows installations.
hi, you must have done something wrong or differently then, please post or email some photos of the output so I can see what you’ve tried
Finally, something that worked! The callout for the EFI volume and navigating to boot there was the thing most other guides were missing. Thank you so much.
I’m glad it helped !
Thank you!
I had three computers in front of me with the same issues, and everything in this post worked like a charm.
NO other website or post on reddit was able to help me but this.
awesome !
Thank you so much!
You saved me from panic.
thanks for replying !
You truly are the 🐐
thank you !
you rock bro 👊
thanks !
Thank you – this has absolutely saved me today after upgrading to an NVME drive and getting a series of seemingly arcane errors. The bootrec access denied error in particular was one I couldn’t get round.
I’m happy it helped Tom, thanks for the positive feedback
I tried and followed all the steps but it still didn’t detect my windows installation. Any idea how to help?
i’d suggest you re-read the entire article to verify you haven’t missed a step or mis-read it, if it’s still failing then feel free to email me detailed photos of the steps you carried out along with the results seen, make sure to capture the screen clearly
email to niall at windowsnoob dot com
cheers
niall
To anyone else still struggeling, i had to format the system volume for fat32, and then run:
bcdboot C:\Windows /s Z: /f UEFI
And then:
diskpart
select partition X
set id=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
exit
Restarted, and Windows boot manager was visible.
Wow! That was what finally fixed it for me (after following guide from article, I was still unable to boot with error inaccessible_boot_device).
After I followed your steps above, windows finally booted. Thanks!
This is as far as I can get. https://imgur.com/a/anaFwtc I presume the partitions should have a file system other than RAW, but I’m not having any luck figuring out how to change it. Paid for AOMEI Partition Assistant and it can’t even see the hard drive. It only sees the flash drive it’s on.
this blog was aimed at fixing invalid boot partitions, not recovering data on faulty hdd’s which is what your’s sounds like, can you give me some more info on your scenario here please
Fixing it is what I was trying to do. I was hoping to avoid the hassle and frustration of reformatting and reinstalling or replacing the hard drive. Essentially, yesterday my computer froze and was unresponsive for minutes, so I hard reset it. When I turned it back on it blue screened with the error as “UNMOUNTABLE_BOOT_VOLUME”. Your blog and some other websites are what I’ve been using to try and fix the MBR. I was wrong about what the partition assistant could see. It could see the hard drive, but believed it had 0 kb on it. Using it to rebuild the MBR (as it was advertised as doing) did nothing at all. It would complete immediately and nothing would change. I suspect there’s no rescuing it, but I commented hoping that you might know of some other fix for my problem that I’ve yet to try. Thanks.
is your drive a spinning disk, if so what make/model ? so you hard powered off when the computer was hanging and now it fails to boot with unmountable boot volume… some more info about your hardware (hdd/ssd/nvme) would be helpful here
Thank you so much. You guide was exactly what I needed to fix the issue I was having. Do you have any insight as to how my original bcd file got corrupted? I was installing a Windows update when this occurred. This is the second Windows update in about a month that I have had to do some extensive Googling to figure out how to fix a computer. The last issue I had, after I rebooted my computer, I got a message that bit locker was enabled. I’ve never used bit locker! If I had not had some level of experience with the command line prompt and a working knowledge of Windows, I’m not sure I would have been able to address either of these issues.
great to hear it Mike, I know that a lot of recent updates patch the Windows Recovery Environment (WinRE) and that may have been what broke your boot configuration data (BCD), for example > https://support.microsoft.com/en-us/topic/kb5042320-windows-recovery-environment-update-for-windows-10-version-21h2-and-22h2-january-9-2024-f5784a62-2b82-4522-b5b2-c31b67049526
i’m not saying the above patch breaks WinRE or your BCD but it (or another cumulative update) may have contributed to it
This guide was a LIFESAVER for us in our Horizon environment. We’re unfortunate victims of the Windows 11 24H2 update to our golden templates in vCenter (which were hacked to not have TPM as per official guidance) and ever since Horizon fails after SYSPREP and injection of vTPM by Horizon on the persistent clones made by them (non-persistent ones work fine cuz they can get away with ClonePrep and that succeeds still). All our persistent clones get made and stuck at this blue screen of winload.efi death!
Your guide, with the steps performed on the generated clone, makes the thing succeed (gets renamed, joined to the domain etc) and the clone becomes available for assignment in Horizon!
thanks for the kind words Billy and for adding context to how it helped you ! Hopefully this will also assist others trying to do the same thing in Vmware Horizon
Hi, I’ve followed your guide and I’m able to find the bcd file, rename it to bcd.old, rebuild it, and even remove the drive letter. But once I reboot it just goes back to booting from my recovery drive, and when I check the cmd total installations are back to zero despite the new and old bcd file appearing. I’ve sent an email with more context and clear images to niall (at) windowsnoob (dot) com, thanks.
Hi, I’ve followed your guide and I’m able to find the bcd file, rename it to bcd.old, rebuild it, and even remove the drive letter. But once I reboot it just goes back to booting from my recovery drive, and when I check the cmd total installations are back to zero despite the new and old bcd file appearing. I’ve sent an email with more context and clear images to niall (at) windowsnoob (dot) com, thanks.
Hello, I followed your guide unfortunately after I type the /rebuildbcd the result is still “Total identified Windows installations 0” I am stump what to do Thanks
can you share photos of your steps and the output to my email > niall AT windowsnoob DOT com