How to Repair EFI/GPT Bootloader on Windows 10 or 11? ,

In this article, we will learn How to Repair the Windows Bootloader on a Modern Computer who uses UEFI Instead of the classic BIOS and GPT disk partition table (instead of MBR). Windows bootloader corruption can occur after installing a second OS (in dual boot configuration), file system corruption, incorrect operation during Windows recovery, deleting some data on hidden partition, malicious software (virus, ransomware, etc.) . for some other reason.

This article contains a step-by-step guide to repairing a damaged or deleted bootloader in Windows 11/10/8.1 and Windows Server 2022/2019/2016/2012R2 on computers running in native (non-compatible) UEFI mode . You can use this guide to repair both binary files and bootloader configuration of Windows bootloader \EFI\Microsoft\Boot\BCD file (in cases where Windows does not boot due to a missing or corrupted BCD boot configuration file).

Windows boot error: Boot configuration data is missing (EFI\Microsoft\Boot\BCD)

If the Windows EFI bootloader is corrupted, a UEFI computer with Windows installed in native mode will not be able to boot. When trying to boot from a disk with a damaged or missing EFI bootloader, the following BSOD (blue screen of death) error appears:

The boot configuration data for your PC is missing or contains errors.
File :\EFI\Microsoft\Boot\BCD
Error code: 0xc000000f


Error code: 0xc000014c

This error indicates that the Windows bootloader configuration (Boot Configuration Data, BCD) has been corrupted or has been removed completely. If you try to repair the bootloader on a UEFI computer bcdedit Tools, you will receive an error:

The boot configuration data store could not be found.
The requested system device cannot be found.

If Windows 10/11 is installed in native UEFI mode on a GPT disk, the Windows EFI bootloader (Windows boot Manager) stores boot manager and BCD configurations separately hidden EFI volume (100 MB in size with FAT32 file system). The bcdedit tool does not see this EFI partition, and cannot manage bootloader configuration on it.

If you only see a black screen with the message “An operating system not found” when booting your computer, it’s likely that the Windows bootloader has been completely removed. Follow the instructions on the link.

Automatic Windows Bootloader Repair with WinRE

The process of automatic repair of EFI bootloader used in Windows Recovery Environment (WinRE) is usually useless in such cases. But it’s still worth a try:

  1. Boot your device from the recovery disc or Windows 10/11 installation media;
  2. press system restore on the installation screen;
  3. then choose troubleshoot problems , startup Repair and select the OS whose bootloader you want to try to repair;windows10 startup repair menu
  4. But most likely the result will be negative: Automatic Repair couldn’t repair your PC, Automatic Repair Could Not Repair Your PC

Using BCDBoot to Manually Repair the EFI Bootloader in Windows

Let’s move on to the process of manually repairing the EFI Windows bootloader on a UEFI computer.

To repair the bootloader configuration (BCD), you must boot from the original Windows installation media (plus, you can use a recovery disc or a special UEFI bootable USB flash drive). After booting into the recovery environment, you need to open a command-line console: select System Restore -> Troubleshoot -> Command Prompt,

You can run Command Prompt even if you only have one Windows installation media. To do this, it is enough to press the key combination Shift + F10 (either Shift + Fn + F10 On some laptop models) at the first Windows setup screen (when choosing a language and keyboard layout).

system restore mode win 8

In the command prompt that opens, run the Disk Management tool:


Display a list of drives on the computer:

list disk

At this stage, it is very important to determine the type of partition table on the disk on which your Windows is installed: MBR either GPT, The issue is that the EFI bootloader is only used on disks with a GPT partition table.

if asterisk (*) is in the Gpt column, the GPT partition table on the disk is used. If not, the MBR is used.

Diskpart: GPT or MBR - Checking Disk Partition Table

If your disk uses a GPT partition table, follow the steps below in the instructions to repair the Windows EFI bootloader.

If you have an MBR partition table on your disk, this guide will not work for your computer. Most likely you have a computer with BIOS or Legacy/Compatibility Support Mode (CSM) option enabled in UEFI settings.

On the MBR disk, the Windows bootloader is stored on a separate system reserved partition, and not on the EFI partition (in any case, do not convert the MBR partition table to GPT until you fix the Windows bootloader !!) Use the other guide to restore the BCD bootloader on a BIOS computer with an MBR (Master Boot Record) disc.

Select the drive where your Windows is installed (if the system has only one hard drive, its index should be 0):

sel disk 0

Display a list of partitions and volumes on this disk: list partition
list volume

Window EFI Partition Table Structure

In this example, you can see that the EFI boot partition has Partition 2 with index (aka volume 5 hidden label). The easiest way to identify an EFI partition is with the FAT32 file system and 100 MB in size (this is the standard minimum size of an EFI partition for Windows computers; in rare cases, the partition size may vary). The most commonly used label for this is System EFI or the ESP/EFI system partition).

In our example, the main partition on which Windows is installed has the volume 2 index, is formatted in the NTFS file system, and is assigned the drive letter C:.

dir C:\

Make sure this drive is included Windows, Program Files, Usersand other directories.

Identify Windows System Partition in WinPay

If these directories are missing, your Windows drive has a different drive letter. Check the contents of the drive with different drive letters.

Write down the drive letter assigned to the Windows partition. We’ll use it as one of the arguments to the bcdboot command a little later.

The partition table must also contain an MSR (Microsoft System Reserved) partition of 16 MB in Windows 10/11 (or 128 MB in Windows 8.1).

Assign the drive letter K: to the hidden EFI volume:

select volume 5
assign letter K:

A message that the drive letter has been successfully assigned to the EFI partition should appear:

DiskPart is successfully assigned the drive letter or mount point.

Close diskpart:
Go to the bootloader directory on the hidden volume:
cd /d K:\efi\microsoft\boot\

In this case, K: is the drive letter just above the EFI partition. If the \EFI\Microsoft\Boot\ directory is missing (error The system can not find the path specified), try the following commands:

cd /d K:\Boot\
cd /d K:\ESD\Windows\EFI\Microsoft\Boot\

At this point, many guides recommend running the following command, which should overwrite the partition boot record, find the installed Windows, and add them to the BCD:

bootrec /fixboot
bootrec /scanos
bootrec /rebuildbcd

or even:
bootrec /FixMbr (Preparing MBR records for GPT discs seems strange)

You can use all of these commands only for MBR-based discs. If your computer boots in UEFI mode, it definitely uses the GPT partition table (as in our case). so when you run bootrec command, you will see an error: access is denied

you need to use bcdboot.exe Tool to restore bootloader files and fix boot records on the EFI partition by copying them from the system directory on the Windows partition. The BCD bootloader configuration has been recreated using %WINDIR%\System32\Config\BCD-Template file.

Use Speciality Command to remove Hidden, Read only and System attributes from BCD file:

attrib BCD -s -h -r

Rename the current BCD configuration file to remove it (this will keep the old boot configuration as a backup): ren BCD BCD.bak
using the bcdboot Tool, you need to copy the important files of the UEFI boot environment from the system directory to the EFI boot partition and rebuild the BCD bootloader config file:
bcdboot C:\Windows /l en-us /s k: /f ALL

  • C:\Windows – the path to the root Windows system directory on the disk (this is your disk on which your Windows is installed, we determined it earlier using the diskpart command);
  • Fall -This means you need to copy the Windows boot environment files, including UEFI and BIOS computers (theoretically able to boot on both UEFI and BIOS computers). To copy only the EFI bootloader, use /f UEFI command;
  • / l n-that —Specifies the system locale to be used when initializing the BCD store. By default, en-us – English (USA) is used;
  • /s k:- Copy the bootloader EFI file to the specified partition;
  • /C – This is a new BCDboot option in Windows 10 that allows you to overwrite existing boot records (including debugsettings). Use this option to ignore the old boot settings and create a clean BCD configuration;
  • /V – used to enable bcdboot verbose output.

Now, if you run bcdedit command, you will see the following:

An entry should appear in the Windows Boot Manager section containing the full path to the UEFI boot file (\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI, In this example, it’s volume 5 (partition=\Device\HarddiskVolume5,

bcdedit: windows boot manager bootmgfw.efi

Windows Boot Manager
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume5
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
bootshutdowndisabled    Yes
default                 {CURRENT}
resumeobject            {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
displayorder            {default}
toolsdisplayorder       {memdiag}
timeout                 30
Windows Boot Loader
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.efi
description             Windows 10
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence       {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

The path to the EFI partition should be in the Windows Boot Manager section (=\Device\HarddiskVolume5 ) and the path to the boot manager file (bootmgfw.efi). The Windows Boot Loader section contains Windows partition information and the path to the Windows EFI bootloader ( \Windows\system32\winload.efi) When you turn it on, your computer will hand over control to the EFI bootloader, which will start the Windows bootloader.

Possible errors:

  • BFSVC Error: could not open bcd template store, status – [c000000f] – Check if the command entered is correct and whether you have a localized Windows version installed. In this case, you need to specify the correct local language code. bcd template file in windowsThe bcdboot tool copies the BCD template files from the \Windows\System32\Config directory. If the BCD template files in this folder are damaged or deleted, try to offline check the integrity of the system files using the sfc.exe tool (you need a Windows installation disc as a source, drive D: in this case In): sfc /scanow /OFFBOOTDIR=C:\ /OFFWINDIR=D:\WINDOWS
  • BFSVC Error: Error copying boot files from last error = 0x570 Try to check the drive using –command CHKDSK K: /F
  • BFSVC error: Failed to set up the Elementor application device. status , [c000000bb] , Check EFI and Windows 10 partition using chkdsk.exe. Verify that the hidden and system attributes of the BCD file are cleared:
    attrib -s -h \EFI\Microsoft\Boot\BCD
    del \EFI\Microsoft\Boot\BCD

    bcdboot: bfsvc error
  • Failure when initializing library system volume – Make sure you are using the correct FAT32 partition with EFI (you can have multiple identical partitions);
  • Failure when trying to copy boot files – Check the Windows drive letter in your bcdboot command. The screenshot below shows the error appeared while trying to copy boot files from the C: drive. In this case, most likely the Windows drive is assigned a different letter, such as D:. You can find the Windows drive and the assigned drive letter by using the diskpart and dir commands (described above).bcdboot error • Failure trying to copy boot files

Now you need to restart your computer and disconnect the bootable media. If you did everything correctly, then Windows boot Manager Should appear in the list of bootable devices, where you can choose the desired operating system to boot from. Your EFI bootloader and BCD configuration has been successfully restored!

In some cases, after repairing the BCD bootloader, when Windows boots up, a BAD SYSTEM CONFIG INFO error appears. To fix the error:

Make sure you haven’t made any recent changes to the UEFI settings. Undo all changes.

Boot your computer from the installation/bootable flash drive and change the bootloader configuration with the command:

  • bcdedit /deletevalue {default} numproc
  • bcdedit /deletevalue {default} truncatememory

Leave a Comment