Bobcares

How to Repair EFI/GPT Bootloader on Windows 10?

by | Dec 28, 2020

Trying to repair EFI/GPT bootloader on Windows 10? We can help you with it.

Here at Bobcares, we have seen several such Windows-related queries as part of our Server Management Services for web hosts and online service providers.

Today we’ll see how to repair the EFI/GPT bootloader on Windows.

 

How to repair EFI/GPT bootloader on Windows 10

Today, we shall see how to repair the Windows bootloader that uses UEFI instead of BIOS and GPT disk partition table. This is useful if Windows does not boot due to missing or damaged boot configuration file \EFI\Microsoft\Boot\BCD.

The corruption of the Windows bootloader might occur after installing a second OS. It may occur due to 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 might fail to boot if the EFI bootloader is corrupted. When trying to boot the computer, the following BSOD error appears:

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

or

Error code: 0xc000014c

Here, the error indicates that the Windows bootloader configuration – Boot Configuration Data is corrupted or even completely removed. However, if we try to repair the bootloader on a UEFI computer using the bcdedit tool, we will receive an error as below:

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

Actually, 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. The bcdedit tool does not see this EFI partition, and cannot manage the bootloader configuration on it.

In case, if the computer boots with a black screen with the message “Operating System not found” then it means that the Windows bootloader is completely removed.

 

Automatic Windows Bootloader Recovery

The procedure for the automatic repair of the bootloader used in the Windows Recovery Environment (WinRE), is generally of no great use in such cases. But anyway it is worth trying.

  • First, we try to boot the device from the recovery disc or install Windows 10 media.
  • Next, on the installation screen, we click the Restore System.
  • Then we select Troubleshoot >> Startup Repair and we select the OS whose bootloader we want to try to recover.
    repair EFI/GPT bootloader
  • However, most likely the result will be negative: Automatic Repair couldn’t repair your PC.

 

Using BCDBoot to Manually Repair EFI Bootloader in Windows 10

Now let’s see how our Support Engineers manually restore the EFI Windows bootloader.

To repair the bootloader configuration, we have to boot from the original installation of Windows 10 media. After booting into the recovery environment, we open a command line: select System Restore >> Troubleshoot >> Command Prompt.

In the command prompt, we run the disk management tool:

diskpart

Then we display the list of drives:

list disk

Now we select the disk with Windows installed (if there is one hard disk in the system, its index should be 0):

sel disk 0

We display list of partitions and volumes on the disk.

list partition
list volume

In this example, we see that the EFI boot partition has the partition 2 index (aka Volume 5 with the Hidden label). The main partition with the installed Windows with the NTFS file system is volume 2. Also, there is an MSR partition of 16 MB for Windows 10 (or 128 MB for Windows 8.1).

Then we assign the drive letter K: to the hidden EFI volume:

select volume 1
assign letter K:

As a result, the below message will appear:

DiskPart is successfully assigned the drive letter or mount point.

Now, we close diskpart:

exit

Then we 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. If the \EFI\Microsoft\Boot\ directory is missing (error The system cannot find the path specified), then we try the following commands:

cd /d K:\Boot\

or

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

We use the attrib command to remove the hidden, read-only, and system attributes from the BCD file:

attrib BCD -s -h -r

In order to delete the current BCD configuration file, we rename it by running the below command(this will keep the old boot configuration as a backup).

ren BCD BCD.bak

Then using the bcdboot.exe utility, we 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

Now, if we run the bcdedit command, we 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 (partition=\Device\HarddiskVolume2).

 

Possible errors:

BFSVC Error: Could not open the BCD template store. status – [c000000f] 

We check if the entered command is correct and whether you have a localized Windows version installed. In this case, we should 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.exe tool (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

We try to check the drive with the help of the below command:

CHKDSK K: /F

 

BFSVC Error: Failed to set element application device. Status = [c000000bb]

We check the EFI and Windows 10 partitions with chkdsk.exe. Verify that the hidden and system attribute of the BCD file is cleared. We remove it:

attrib -s -h \EFI\Microsoft\Boot\BCD
del \EFI\Microsoft\Boot\BCD
bcdboot: bfsvc error

 

Failure when initializing library system volume

We make sure you are using the correct FAT32 partition with EFI (you may have several similar partitions).

Finally, now we restart the computer and disconnect the bootable media. Then the Windows Boot Manager appears in the list of bootable devices, where we can choose the desired operating system to boot. Your EFI bootloader and BCD configuration have been restored successfully!

[Need any further assistance with Windows queries? – We are here to help you]

 

Conclusion

Today, we saw how our Support Engineers repair EFI/GPT bootloader on the Windows server.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

10 Comments

  1. Ivan Weaver

    Great article/write-up!! I have now rescued 2 machines stuck in the transition!! Including my own home desktop!
    I made adjustments based on the computer i was on for the Windows drive and the relevant EFI/Fat32/Boot drive.

    Reply
    • Maheen Aboobakkar

      We are happy to hear that the solution you found in this article allowed you to solve the problem.

      Reply
  2. xma

    Thanks in advance. This one did it. Many other (similar) sites not.
    After some others … was almost about switching to Linux … but then “Ok. One last try.”
    *Yes* *Thumbs up* 😉

    Reply
    • Maheen Aboobakkar

      We are pleased to learn that you were able to resolve the issue using the information in this article.

      Reply
  3. Owen Carlton

    At the End of DISKPART = Exit, I ran the Command cd /d K:\Boot\ and got Device Not Ready & the same for the next Alternate Command Line – What the Hell is wrong.
    I am somewhat sicjk of running Commands to fix UEFI GPT Boot, and get NO RESULTS.
    Please advise Thank You.

    Reply
    • Hiba Razak

      Hi,
      Our Experts can help you with the issue, we’ll be happy to talk to you on chat (click on the icon at right-bottom).

      Reply
      • TopDAW

        Brilliant, thank you so much – I managed to restore my dual-boot system with your help!

        Reply
        • Hiba Razak

          Hi,
          We are glad to know that our article helps you solves the issue ?

          Reply
  4. Name *jose

    Gracias funciono sin problemas

    Reply
    • Hiba Razak

      Hi,
      Thanks for the feedback. We are glad to know that our article was helpful for you 🙂 .

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.