Windows OS Hub
  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange

 Windows OS Hub / Windows 10 / How to Rebuild BCD File and Master Boot Record (MBR) in Windows 10?

November 13, 2019 Windows 10

How to Rebuild BCD File and Master Boot Record (MBR) in Windows 10?

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:

Your PC needs to be repaired
The Boot Configuration Data file is missing some required information
File: \Boot\BCD
Error code: 0xc0000034

The Boot Configuration Data file is missing some required information

Also, the error may look like this:

The Boot Configuration Data for your PC is missing or contain errors.

File: \boot\bcd

Error Code: 0xc000000f

If the MBR is corrupted, there may be a “No operating system found” error.

windows 10: boot bcd error 0xc000000f

If the error text refers to the winload.efi file, go to the article Winload.efi is missing in Windows 10.

Contents:
  • How to Automatically Repair Bootloader in Windows 10?
  • Identifying Disk Partition Style and Drive Letters
  • Repair Master Boot Record (MBR) in Windows 10
  • How to Manually Rebuild Boot Configuration File on Windows 10?

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).

Tip. It is advisable to periodically check the health of the WinRE environment, and if it doesn’t work, use the method described in the article “How to Recover WinRE in Windows 10” to restore it.

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.

Windows Recovery Environment - run Command Prompt

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

Very important. All instructions given below are suitable for standard BIOS computers with the MBR partition table. For UEFI-based computers you need to use the following guides to repair the bootloader in Windows 10/8 with EFI or in Windows 7.

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.

 check disk partition table gpt or mbr

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:

diskpart
list vol

diskpart - reserved partition

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.
Important. Remember the assigned drive letters, since they will be used in the commands later.

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

Before moving on, try to automatically re-create the BCD bootloader configuration with following commands (this is the easiest way for beginners):

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.

bootsect.exe /nt60 all /force

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

If the drive letter is not assigned to the System Reserved partition (by default), you can assign it yourself using diskpart. Run: 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

recreating bcd in windows 10 using bcdedit

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.

bcdedit - The entry 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

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
6
Facebook Twitter Google + Pinterest
previous post
Using RDCMan (Remote Desktop Connection Manager)
next post
FAQ: Windows 10 Enterprise LTSC 2019 Explained

Related Reading

How to Disable NetBIOS and LLMNR Protocols in...

April 9, 2021

Enable Windows Lock Screen after Inactivity via GPO

April 8, 2021

Can’t Copy and Paste via Remote Desktop (RDP)...

March 31, 2021

UAC: This App Has Been Blocked for Your...

March 30, 2021

How to Unlock a File Locked by Any...

March 29, 2021

15 comments

George January 2, 2018 - 1:53 pm

What if we use a restoration disc?

Reply
Chad February 19, 2019 - 6:45 am

wow, saved my bacon! I had to format the system reserved directory then go through all this!

Reply
Anderson March 7, 2019 - 11:08 am

Is the best tutorial for restore the boot file you are the master ty for all

Reply
SuccessfulUser September 15, 2019 - 1:05 pm

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.

Reply
CA Age Management November 13, 2019 - 5:17 pm

great until … the store import operation has failed.. Requested system device cannot be found. that is where I am stuck

Reply
Shlomi November 27, 2019 - 9:14 am

WOW Perfect guide so far!
many thanks!! Keep it

Reply
David December 25, 2019 - 11:06 pm

thank you for all your help

Reply
Kostya January 10, 2020 - 1:11 pm

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”.

Reply
arash August 24, 2020 - 1:03 pm

“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

Reply
KP November 8, 2020 - 4:24 pm

Leave a space between {default} and device

Reply
Ivo September 18, 2020 - 11:58 am

Saved my day 🙂

Reply
Karthik P November 8, 2020 - 4:25 pm

All commands worked correctly but I am still getting the same 0xc000000f error on reboot.

Reply
Doc Orange November 20, 2020 - 7:46 pm

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!

Reply
Chris January 14, 2021 - 3:07 pm

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.

Reply
ruvane January 24, 2021 - 10:04 am

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!

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange
  • Windows 10
  • Windows 8
  • Windows 7
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2008 R2
  • PowerShell
  • VMWare
  • MS Office

Recent Posts

  • How to Disable NetBIOS and LLMNR Protocols in Windows Using GPO?

    April 9, 2021
  • Enable Windows Lock Screen after Inactivity via GPO

    April 8, 2021
  • How to Create and Manage Scheduled Tasks with PowerShell?

    April 7, 2021
  • Updating Windows VM Templates on VMWare with PowerShell

    April 5, 2021
  • Running Multiple IIS Websites on the Same Port or IP Address

    April 1, 2021
  • Can’t Copy and Paste via Remote Desktop (RDP) Clipboard

    March 31, 2021
  • UAC: This App Has Been Blocked for Your Protection on Windows 10

    March 30, 2021
  • How to Unlock a File Locked by Any Process or SYSTEM?

    March 29, 2021
  • Configuring a Domain Password Policy in the Active Directory

    March 26, 2021
  • Using Native Package Manager (WinGet) on Windows 10

    March 24, 2021

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Allow Multiple RDP Sessions in Windows 10?
  • How to Repair EFI/GPT Bootloader on Windows 10?
  • How to Restore Deleted EFI System Partition in Windows 10?
  • Network Computers are not Showing Up in Windows 10
  • Booting Windows 7 / 10 from GPT Disk on BIOS (non-UEFI) systems
  • Removable USB Flash Drive as Local HDD in Windows 10 / 7
  • How to Create a Wi-Fi Hotspot on your Windows 10 PC
Footer Logo

@2014 - 2018 - Windows OS Hub. All about operating systems for sysadmins


Back To Top