How to Repair Windows Boot Manager, BCD and Master Boot Record (MBR) | Windows OS Hub (2024)

Windows OS Hub / Windows 10 / How to Repair Windows Boot Manager, BCD and Master Boot Record (MBR)

The Boot Manager in 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 correctly rebuild Windows Boot Manager, BCD configuration file, and fix MBR on Windows 10 and 11.

Contents:

  • The Boot Configuration Data File is Missing in Windows 10 or 11
  • How to Automatically Repair Windows Bootloader?
  • Identifying Disk Partition Layout and Drive Letters
  • Repair Master Boot Record (MBR) on Windows 10/11
  • How to Recreate a Windows Boot Configuration (BCD) from Scratch?

The Boot Configuration Data File is Missing in Windows 10 or 11

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:

Your PC needs to be repairedThe Boot Configuration Data file is missing some required informationFile: \Boot\BCDError code: 0xc0000034

Also, the error may look like this:

The Boot Configuration Data for your PC is missing or contains errors.File: \boot\bcdError Code: 0xc000000f

If the MBR is damaged, there may be an “An operating system wasn’t found” error.

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

How to Automatically Repair Windows Bootloader?

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” to repair it.

If the automatic repair using Startup Repair didn’t help, boot your computer from the Windows boot/installation media or in the WinRE environment (Repair your computer -> Troubleshoot-> Advanced options -> Command Prompt). Start a command prompt, try to create a new BCD file, and update the MBR record from scratch.

In this example, I will use the Windows 10 installation disk. Change the primary boot device to a DVD drive or USB flash drive with Windows setup files 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 repair the BCD file automatically using this command:

bootrec /RebuildBCD

Reboot your computer and check if Windows boots (don’t forget to change the boot device priority in the BIOS settings). If Windows does not boot, boot from the installation media again and open a command prompt.

Identifying Disk Partition Layout and Drive Letters

Very important. All instructions given below are suitable for standard BIOS computers (or booting in UEFI legacy mode) with the MBR partition table. On computers with UEFI firmware, you need to use the following guides to repair the EFI bootloader on Windows 10 or to restore the deleted EFI partition.

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 a 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 to restore Windows the bootloader, you need to use the article from the link above;
  • 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 guide.

Next, you need to identify the local drives and volumes on your computer (most likely the drive 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

You will see a 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 it:

  • System Reserved partition with the size of 500 MB and the drive letter C: assigned to it. By default, Windows Boot Manager and BCD file are located on this small 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) on Windows 10/11

You can use the bootrec.exe tool to overwrite data in the MBR and boot sector, and add the necessary path to Windows Boot Manager.

Try overwriting the master boot record (MBR) of the system partition for compatibility with the Windows boot loader (the existing partition table is not overwritten).

bootrec.exe /fixmbr

Add code to the boot sectors of the disk to load the bootmgr (Windows Boot Manager) file:

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 rebuild the BCD bootloader configuration with the following commands (this is the easiest way for beginners):

bootrec /FixBoot – the command creates a new boot sector on the system partition and overwrites the boot record of the PBR partition.
bootrec /ScanOs – scan all drives and look for installed copies of Windows that are not in the Boot Configuration store
If the scan is successful, you will be prompted to add entries about found Windows instances to the BCD configuration:

Scanning all disks for Windows installations. Please wait, since this may take a while... Successfully scanned Windows installations. Total identified Windows installations: 1 [1] D:\Windows Add installation to boot list? Yes/No/All:

bootrec /RebuildBcd – recreate the bootloader configuration store and add copies of Windows found on the computer to the BCD bootloader.

After that, restart your computer and check if Windows boots properly. If the OS doesn’t boot, follow the instructions below.

How to Recreate a Windows Boot Configuration (BCD) from Scratch?

Next, use the using BCDedit command to create a new Boot Configuration Data file (it is supposed, you don’t have the BCD backup file).

Your next steps depend on whether the disk has a separate System Reserved partition or not. Run the commands:

diskpart
list vol

Check if there is a System Reserved partition on the hard disk. It can be identified by its volume label, or more precisely by its size (500 MB for Windows 10+, 350 MB for Windows 8.1, and 100 MB for Windows 7).

  • If there is no system-reserved partition (perhaps you accidentally deleted it), you can store the Boot Manager files on the system drive where the Windows directory is located. To create the Bootmgr and BCD bootloader configuration files on the specified drive, run the command:
    bcdboot C:\Windows /S C:
    A message should appear:
    Boot files successfully created.
  • If you have a System Reserved partition, delete the old (corrupted) BCD file 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 connected, 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 the drive 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 Windows 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

If the bcdedit command returns an error while accessing a BCD file (access denied, the store import operation has failed, the required system device cannot be found, the volume does not contain a recognized file system. please make sure that all required file system drivers are loaded and that the volume is not corrupted), try removing hidden, read-only, and system attributes from it:

attrib C:\Boot\BCD -s -h -r

Specify that the Windows Boot Manager is located on the System Reserved partition (the drive letter C: is assigned to it):

bcdedit.exe /set {bootmgr} device partition=c:

Configure the timeout to select an OS:

bcdedit.exe /timeout 10

Remove the temporary file:
del c:\boot\bcd.tmp

So, you have created an empty BCD file with the bootloader settings. Now you have to add entries about the installed Windows.

Create a new entry in the BCD configuration for Windows 10:

bcdedit.exe /create /d "Windows 10" /application osloader

The command will return the unique identifier (GUID) of this bootloader entry.

The entry {8a7f03d0-5338-11e7-b495-c7fffbb9ccfs} was successfully created.

Specify that bootmgr should use this entry by default (after the timeout, this entry will be used to boot Windows):

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 found out earlier that the drive letter D: is assigned to the Windows partition in WinPE. 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 entry in BCD visible, since it is hidden by default:

bcdedit.exe /displayorder {default} /addlast

So we have completely recreated Windows 10 bootloader (bootmgr) and BCD file and overwritten the MBR boot sector.

Now you need to make active the partition on which the bootmgr and BCD file with the Windows bootloader configuration are located (BIOS transfers control to the OS bootloader on the active MBR partition). For example, the following partitions are available on your computer

  • Volume 0 – installation flash drive (ISO image) from which you booted the computer;
  • Volume 1 – System Reserved partition (500 MB size) with Windows bootmgr and BCD file;
  • Volume 2 – partition with Windows system folders (%Windir%, Program Files, Users, and etc.)

In this example, you need to make Volume 1 the active partition (in your case, you need to find out your partition number). You can make a partition active using diskpart:

diskpart
list disk
sel disk 0
list vol
select volume 1
(bootmgr and \Boot\BCD must be on this partition )
active
exit

Check that volume 1 is now active:

select vol 1
detail partition

(Active: Yes )

Now you can restart your computer and make sure that Windows boots normally.

How to Repair Windows Boot Manager, BCD and Master Boot Record (MBR) | Windows OS Hub (2024)
Top Articles
Latest Posts
Article information

Author: Neely Ledner

Last Updated:

Views: 5857

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.