The Boot Manager in the modern Windows versions uses the BCD (Boot Configuration Data) file to boot the operating system installed on the computer. This file contains information about the installed OS and boot parameters. Windows cannot boot normally if the BCD file is deleted or corrupted. Also, you won’t be able to boot your Windows if the Mater Boot Record (MBR) on the hard disk is damaged. In this article, we will show how to manually rebuild the boot configuration (BCD) file and fix MBR on Windows 10.
If the BCD file is missing or corrupted, if you removed/formatted a separate disk partition with the System Reserved label (and 500 MB in size) or a special OEM recovery partition, a user is likely to see the following message when trying to boot Windows 10:
The Boot Configuration Data file is missing some required information
File: \Boot\BCD
Error code: 0xc0000034
Also, the error may look like this:
File: \boot\bcd
Error Code: 0xc000000f
If the MBR is corrupted, there may be a “No operating system found” error.
How to Automatically Repair Bootloader in Windows 10?
If this error appears, first of all, try to fix the problem with booting the OS using the Startup Repair mode that can be started from the Windows Recovery Environment (Windows RE).
If the automatic repair using Startup Repair did not help, boot your computer from Windows boot/installation disk or in the WinRE environment (Repair your computer -> Troubleshoot -> Advanced options -> Command Prompt). Start the command prompt and try to create a new BCD file and update the MBR record from scratch.
In this example, I will use Windows 10 installation disk. Change the primary boot device to DVD drive or USB flash drive in the BIOS settings (depending on which device you want to boot the computer from). Boot your computer from the Windows install image and press Shift + F10 on the language selection screen. You will see a command prompt.
Try to restore the BCD file automatically using this command:
bootrec /RebuildBCD
Reboot your computer and check if Windows boots (do not forget to change the boot priority settings in BIOS). If it isn’t, boot from the installation disk again and start the command prompt.
Identifying Disk Partition Style and Drive Letters
How to understand if you have a computer with BIOS or UEFI? The easiest way is to check the disk partition table on which Windows is installed: GPT or MBR. To do this, run the command:
diskpart
Then list available disks:
list disk
If the disk has an asterisk (*
) in the Gpt column, then the GPT partition table is used on this disk (this means that you have a computer with UEFI and you need to use the article from the link above to restore the Windows bootloader). If there is no asterisk in the GPT column, then you have the MBR partition table on the disk, and you can continue to follow this instruction.
Next, you need to identify the local drives and volumes on your computer (most likely the volume letters assigned to them will be different from those you see when working in Windows). It is easier to do it using diskpart. Run these commands:
You will see the list of partitions, the drive letters assigned to them and their sizes. In our case, there is one hard drive on the computer with the two volumes on them:
- System Reserved partition with the size of 500 MB and the drive letter C: assigned to it. By default, BCD file is located in this little service partition (read more);
- NTFS partition with the size of 39 GB and the letter D: assigned. This partition contains installed Windows, programs and user data.
Repair Master Boot Record (MBR) in Windows 10
Using the following commands, we’ll overwrite the Master Boot Record on boot sector of your hard drive, and add the necessary links to Windows 10 bootloader.
bootrec.exe /fixmbr
bootsect.exe /nt60 all /force
If bootsect.exe command is not found, try to specify the full path to it:
X:\boot\bootsect.exe /nt60 all /force
bootrec /FixBoot
– the command recreates the boot sector on the system partition;
bootrec /ScanOs
bootrec /RebuildBcd
– scan all disks and search for installed Windows, add found copies to the BCD bootloader configuration.
After that, restart the computer and check the Windows boot. If the OS doesn’t boot, follow the instructions below.
How to Manually Rebuild Boot Configuration File on Windows 10?
Then using BCDedit command, create a new Boot Configuration Data file (it is supposed, you don’t have the BCD file backup).
Delete the old (corrupted) BCD file in System Reserved partition and create a new one instead:
del c:\boot\bcd
diskpart
Select your local disk (in my case, only one hard disk is installed on the computer, but you can list local disks with the list disk command): select disk 0
The screenshot above shows that the System Reserved partition is called Volume 1. Select it: select volume 1
Assign a drive letter (I assigned a letter C:, but you can use any other letter, in this case change the path in the following commands): assign letter C:
exit
Create an empty temporary file bcd.tmp:
bcdedit /createstore c:\boot\bcd.tmp
Create an entry for the Boot Manager (bootmgr):
bcdedit.exe /store c:\boot\bcd.tmp /create {bootmgr} /d "Windows Boot Manager"
Import settings from bcd.tmp to your BCD:
bcdedit.exe /import c:\boot\bcd.tmp
Specify that the Boot Manager is located on the System Reserved partition (the letter C: is assigned to it): bcdedit.exe /set {bootmgr} device partition=c:
Configure the timeout to select an OS:
bcdedit.exe /timeout 10
Delete the temporary file:
del c:\boot\bcd.tmp
So we have a file with the bootloader parameters. Now you have to add the entries about the installed Windows.
Create a new entry for Windows 10 in the BCD configuration:
bcdedit.exe /create /d "Windows 10" /application osloader
The command will return the unique identificator (GUID) of this bootloader entry.
The entry {8a7f03d0-5338-11e7-b495-c7fffbb9ccfs} was successfully created.
Specify that bootmgr must use this entry by default (after the timeout, this entry is used to boot):
bcdedit /default {8a7f03d0-5338-11e7-b495-c7fffbb9ccfs}
Now you have to specify the paths to the installed Windows 10 copy in the new bootloader entry. We have seen in WinPE that the letter D: is assigned to Windows partition. Use this drive letter in the following commands:
bcdedit.exe /set {default}device partition=d:
bcdedit.exe /set {default} osdevice partition=d:
bcdedit.exe /set {default} path \Windows\system32\winload.exe
bcdedit.exe /set {default} systemroot \Windows
Make this boot record in BCD visible, since it is hidden by default:
bcdedit.exe /displayorder {default} /addlast
So we have re-created Windows 10 bootloader and BCD file, and fixed the boot sector on MBR. Now you can restart your computer and make sure that Windows 10 boots as usual.
15 comments
What if we use a restoration disc?
wow, saved my bacon! I had to format the system reserved directory then go through all this!
Is the best tutorial for restore the boot file you are the master ty for all
For anyone coming here late like I am, I tried my best to use the directions here to get windows to boot, but to no avail.
Specific circumstances: I migrated my windows installation to a samsung ssd a while ago with some issues, but the short version is the OS got migrated to the ssd, however the boot partition stayed on the original hdd. Without realizing this I did a ‘clean all’ command on the hdd, accidentally leaving me with no boot partition at all.
What worked:”format V: /FS:FAT32
bcdboot C:\Windows /s V: /f UEFI”
My best guess: The directory tree structure for this doesn’t seem to be the same as the what’s in the article on this page, so perhaps that has something to do with it.
great until … the store import operation has failed.. Requested system device cannot be found. that is where I am stuck
WOW Perfect guide so far!
many thanks!! Keep it
thank you for all your help
With all these excellent things there is one not mentioned here but may also be important. In case you’re not RESTORING but making another disc bootable, you’ll need to copy ‘bootmgr’ to the root of your target disc to boot.
You Windows folks rely heavily on the system doing the right thing? That is often seen in the way Windows tips ans manuals are written… Well you may have noticed that if it did so we would NOT need any tutorials like this one at all, would we. So — it DOES NOT do the right thing sometimes. Like in my case — Windows installer assumed WITHOUT EVER ASKING ME that it’s OK to install Windows on one disk and install boot files on another. So I’m trying now to make it boot from the one OS is installed on. And then it was that /bootmgr had to be copied over in order to make ALL THIS work. None of the commands above takes care of this. Why? Because of assuming it IS THERE ALREADY. Which is, again, by far not always the case.
Otherwise, thank you, VERY helpful as to how to recreate BCD. Oh, except that I also had that denial to import the bcd.tmp because the “device was not found”.
“The entry was successfully created” and I put the entry provided as default but when I go to the next step:
Bcdedit /set {default}device partition=h: //h is where my win10 is installed
I get this error: “An error occurred while attempting to reference the specified entry. The system cannot find the file specified.”
What should I do?
*Your help may save months of my life
Leave a space between {default} and device
Saved my day 🙂
All commands worked correctly but I am still getting the same 0xc000000f error on reboot.
This is the BEST guide to save the bacon when you’ve f—-d your Windows 10 install (MBR) and bootrec, etc. just won’t work.
Two important notes:
1. I did this on an MBR (BIOS boot) installation of Windows 10. **Most Windows 10 users have GPT partition, not MBR, with UEFI boot, not BIOS.** Not sure if this guide will work for GPT/UEFI installs.
2. Your System Reserved Partition must be marked as active before you do these steps! Use diskpart from the installer Command Prompt. Google for directions, e.g. https://www.sevenforums.com/tutorials/71432-partition-mark-active.html
Mark the partition called “System Reserved” as active. Then reboot to the installer before trying these steps or your drive letters will be wrong and the process won’t work!
excellent guide, thank you so much for putting this together! i’ve never been happier to see a PC booting again haha 😀
i just had to disable my 2nd hard drive to make the import operation work – not sure why.
Hi there.
Really hoping you can help!
I get as far as bcdedit /import c:\boot\bcd.tmp when the import fails and I get the message “The requested system device cannot be found”.
What am I doing wrong?
Thanks!