In this article we will learn how to repair Windows bootloader on a modern computer that uses UEFI instead of BIOS and GPT disk partition table (instead of MBR). The corruption of the Windows bootloader can occur after installing a second OS (in Dual Boot configurations), incorrect actions during Windows recovery, removal of some data on hidden partitions, malicious software (virus, ransomware, etc.) and for some other reasons.
The boot configuration data for your PC is missing: EFI\Microsoft\Boot\BCD
A computer with Windows 10 installed in native UEFI mode will fail to boot if the EFI bootloader is corrupted. When trying to boot the computer, 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 even completely removed. If you try to repair the bootloader on a UEFI computer using the
bcdedit tool, you will receive an error like this:
The boot configuration data store could not be found. The requested system device cannot be found.
The fact is that if Windows 10 is installed in native UEFI mode on a GPT disk, then the Windows 10 EFI bootloader (Windows Boot Manager) stores the boot manager and BCD configuration on a separate hidden EFI volume (100 MB in size with the FAT32 file system). The bcdedit tool doesn’t see this EFI partition, and cannot manage the bootloader configuration on it.
Automatic Windows Bootloader Recovery
The procedure for the automatic repair of the bootloader used in the Windows Recovery Environment (WinRE), is usually useless in such cases. But it’s worth a try anyway:
- Try to boot your device from the recovery disc or installation Windows 10 media;
- On the installation screen, click the Restore System;
- Then select Troubleshoot -> Startup Repair and select the OS whose bootloader you want to try to recover;
- But most likely the result will be negative:
Automatic Repair couldn’t repair your PC.
Using BCDBoot to Manually Repair EFI Bootloader in Windows 10
Let’s move on to the procedure for manually restoring the EFI Windows bootloader on a computer with UEFI.
To repair the bootloader configuration (BCD), you have to boot from the original installation Windows 10 media (or a recovery disk or a special UEFI bootable USB flash drive). After booting into the recovery environment, you need to open a command line: select System Restore – > Troubleshoot-> Command Prompt).
In the command prompt that opens, run the disk management tool by typing the command:
Display the list of drives on the computer:
If the disk has an asterisk (
*) in the Gpt column, then the GPT partition table is used, if not, the MBR is used.
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 instruction won’t work for your computer. Most likely you have a computer with BIOS or Legacy/Compatibility Support Mode (CSM) option enabled in the UEFI settings.
On MBR disks, the Windows bootloader is stored on a separate System Reserved partition, not on an EFI partition (in any case, don’t convert the MBR partition table to GPT until you fix the Windows bootloader !!). Use another guide to restore the BCD bootloader on MBR (Master Boot Record) disk.
Select the disk with Windows installed (if there is one hard disk in the system, its index should be 0):
sel disk 0
Display the list of partitions and volumes on the disk:
In this example, you can see that the EFI boot partition (it can be easily identified by the size of 100 MB, and the FAT32 file system, most often its label is System EFI) has the partition 2 index (aka Volume 5 with the Hidden label). The main partition with the installed Windows with the NTFS file system (it can be both Windows 10 and Windows 8.1) is volume 2. There must also be an MSR (Microsoft System Reserved) partition of 16 MB for Windows 10 (or 128 MB for Windows 8.1).
Assign the drive letter K: to the hidden EFI volume:
select volume 1
assign letter K:
A message that the drive letter has been successfully to the EFI partition should appear:
DiskPart is successfully assigned the drive letter or mount point.
Close the diskpart:
Go to the bootloader directory on the hidden volume:
cd /d K:\efi\microsoft\boot\
In this case, K: is the drive letter assigned to the EFI partition just above. If the \EFI\Microsoft\Boot\ directory is missing (error The system cannot find the path specified), try the following commands:
cd /d K:\Boot\
cd /d K:\ESD\Windows\EFI\Microsoft\Boot\
bootrec /FixMbr(recovering MBR record for a GPT disk looks strange)
All of these commands are applicable only for disks with MBR. If your computer boots in UEFI mode, then it necessarily uses the GPT partition table (as in our case). Therefore, when you run
bootrec commands, you will see an error:
access is denied
To fix boot records on an EFI partition, you need to use the
BCDBoot tool. The BCDBoot tools allows you to restore bootloader files on the system partition by copying them from the system directory on the Windows partition. The BCD bootloader configuration is recreated using the
Use the attrib command to remove the hidden, read-only, and system attributes from the BCD file:
attrib BCD -s -h -r
Delete the current BCD configuration file by renaming it (this will keep the old boot configuration as a backup):
ren BCD BCD.bak
Using the bcdboot.exe utility, you need to recreate the BCD store by copying the UEFI boot environment files to the boot partition from the Windows directory:
bcdboot C:\Windows /l en-us /s k: /f ALL
- C:\Windows – is the path to the directory with Windows 10 installed;
- /f ALL – means that you want to copy the Windows Boot Environment files, including those for UEFI and BIOS computers (potential ability to boot in UEFI and BIOS systems). To copy only the EFI bootloader, use the /f UEFI command;
- /l en-us — is a type of the system locale. By default, en-us – English (USA) is used;
- /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 old boot settings and create a clean BCD configuration;
- /v – used to enable BCDBoot verbose output.
bcdboot c:\Windows /l en-uk /s K: /f ALL
Windows 10 Dutch:
bcdboot c:\Windows /l nl-NL /s K: /f ALL
Windows 10 Deutch (German):
bcdboot c:\Windows /l de-DE /s K: /f ALL
Now, if you run the
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 is located on volume 2 (
- BFSVC Error: Could not open the BCD template store. status – [c000000f] – check if the entered command is correct and whether you have a localized Windows version installed. In this case you need specify the correct local language code. The bcdboot tool copies the BCD template files from the \Windows\System32\Config directory. If the BCD templates in this folder are damaged or deleted, try to check the integrity of the system files offline using the
sfc.exetool (you need a Windows installation disc – drive D :):
sfc /scanow /OFFBOOTDIR=C:\ /OFFWINDIR=D:\WINDOWS
- BFSVC Error: Error copying boot files from Last Error = 0x570 – try to check drive with the help of command:
CHKDSK K: /F
- BFSVC Error: Failed to set element application device. Status = [c000000bb] – check the EFI and Windows 10 partitions with
chkdsk.exe. Verify that the hidden and system attribute of the BCD file is cleared. Remove it:
attrib -s -h \EFI\Microsoft\Boot\BCD
- Failure when initializing library system volume – make sure you are using the correct FAT32 partition with EFI (you may have several similar partitions).
Now you need to restart your computer and disconnect the bootable media. Then the Windows Boot Manager appears in the list of bootable devices, where you can choose desired operating system to boot. Your EFI bootloader and BCD configuration have been restored successfully!