Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

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

June 8, 2023 Windows 10Windows 11Windows Server 2019

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 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 contains errors.
File: \boot\bcd
Error Code: 0xc000000f

If the MBR is damaged, there may be an “An operating system wasn’t 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.

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 Windows boot/installation disk 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.

Windows Recovery Environment - run Command Prompt

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

 check disk partition table gpt or mbr

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

diskpart - reserved partition

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 them:

  • 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, 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.

bootsect.exe /nt60 all /force

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

check disk for system reserved partition in winpe with diskpart

  • 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

recreating bcd in windows 10 using bcdedit

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.

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

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

check system reserved partition volume number

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 )

set active mbr partition with diskpart

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

32 comments
24
Facebook Twitter Google + Pinterest
previous post
How to Automatically Fill the Computer Description in Active Directory
next post
Configure SR-IOV for Hyper-V Virtual Machines on Windows Server

Related Reading

How to Use Ansible to Manage Windows Machines

September 25, 2023

Installing Language Pack in Windows 10/11 with PowerShell

September 15, 2023

How to View and Change BIOS (UEFI) Settings...

September 13, 2023

How to Create UEFI Bootable USB Drive to...

September 11, 2023

Redirect HTTP to HTTPS in IIS (Windows Server)

September 7, 2023

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023
  • How to Create UEFI Bootable USB Drive to Install Windows

    September 11, 2023
  • Redirect HTTP to HTTPS in IIS (Windows Server)

    September 7, 2023
  • Add an Additional Domain Controller to an Existing AD Domain

    September 6, 2023
  • How to Install an SSL Certificate on IIS (Windows Server)

    September 5, 2023
  • Managing Windows Firewall Rules with PowerShell

    August 31, 2023
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows

    August 30, 2023

Follow us

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Allow Multiple RDP Sessions on Windows 10 and 11
  • How to Repair EFI/GPT Bootloader on Windows 10 or 11
  • How to Restore Deleted EFI System Partition in Windows
  • Network Computers are not Showing Up in Windows 10/11
  • How to Run Program without Admin Privileges and Bypass UAC Prompt
  • Fix: BSOD Error 0x0000007B (INACCESSABLE_BOOT_DEVICE) on Windows
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows
Footer Logo

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


Back To Top