In this article, we will learn about how to restore Windows 10 boot loader on a modern computer that uses UEFI interface instead of BIOS and GPT (instead of MBR) disk partition table.
- The main reasons of EFI boot loader corruption
- GPT disk partitioning structure for Windows 10
- How to repair the EFI boot loader using Windows automatic boot loader recovery function?
- How to repair the EFI boot loader manually in Windows 10?
- What to do if important data is lost due to incorrect EFI boot loader repairing?
The main reasons of EFI boot loader corruption
The EFI boot loader corruption is quite common. The main symptom of boot loader damage is the system refusing to boot, which is accompanied by an error:
The boot configuration data for your PC is missing or contains errors.
Error code: 0xc0000***
This error indicates that the file at the above EFI\Microsoft\Boot\BCD address is corrupted and because of that the data in the Boot Configuration Data file does not recognize your Windows boot loader configuration.
If you see a blue screen of death with this message then you can be sure that the reason why the system can’t boot is because of the EFI boot loader.
The most common causes of EFI boot loader corruption are:
- Installation of a second operating system;
- Improper system recovery operations (or a failed system restore);
- Deleting some data from hidden partitions. Usually, it happens with inexperienced users, for example, when using Disk Management utility, they can delete or format partition containing EFI boot loader;
- Bad sectors. It is also very common case, when drive, because of its age (or for some other reason) has dead sectors and thus data on it becomes corrupted;
- The action of viruses or spyware.
Whatever the reason for damaging the boot loader, it is important to know how to repair it, because quite often you can fix the situation yourself, without having to go to a specialist.
GPT disk partitioning structure for Windows 10
In this chapter, we decided to review the GPT disk structure for Windows 10 so that the user can more easily understand how UEFI works, so that the user can identify which partition contains the EFI boot loader and so that the user does not accidentally format this partition.
The partition structure in the GPT table on a Windows booted in UEFI mode most often looks like this:
— EFI is the ESP (Extensible Firmware Interface) partition where the software with the drivers that enable Windows to boot is stored;
— MSR (Microsoft Reserved) is the partition which is reserved during Windows Setup and may or may not exist on your machine
— Primary partition – the volume where system files are stored: registry, services, system utilities, configuration files, etc.
Windows 10 also adds a Recovery volume. By default (i.e., when you install Windows on a UNFORMATED disk), the first two partitions have a clear size. In Windows 10, for example, they are 100MB and 128MB, respectively, and so it’s easy to separate them as needed, based only on the size of both.
This is a classic configuration. Some computer manufacturers create their partitions by also embedding the Windows PE recovery environment in the winre.wim file. If you find such a file, you should know that it contains the manufacturer’s system restore image.
The EFI partition is mandatory on GPT disks with UEFI support. When the computer powers on, the UEFI environment loads the boot loader (EFI\Microsoft\Boot\bootmgfw.efi) from the EFI partition (ESP), giving it control over booting Windows itself. Accordingly, if there is no such partition or the files on it are corrupted, the system will not be able to boot.
The MSR partition on the disk is created to facilitate partition review and is used for system operations (e.g., converting a disk from a simple to a dynamic one). It is a reserved partition, which Windows never assigns any identification marks to. And it does not contain user data. In Windows 10, the MSR partition size is 16 MB and the file system type is NTFS.
How to repair the EFI boot loader using Windows automatic boot loader recovery function?
The boot loader recovery procedure integrated into the Windows recovery environment (WinRe) is not a bad solution, although it is not always possible to fix the EFI boot loader using this method. However, it is still worth trying.
To do so:
Step 1: Boot from a bootable drive, recovery disk, or Windows 10 installation flash drive;
You can read about how to create a bootable Windows 10 flash drive in this article.
Step 2: On the installation screen, click “Repair your computer” or press the key combination “Shift + F10”;
Step 3: In the window that appears, select “Troubleshoot”
Step 4: Click the “Advanced options” button
Step 5: Click on “Start-up repair” and select the system you want to repair the EFI boot loader for.
After that, the system will try to repair the EFI boot loader automatically. If all goes well, your boot loader will be fine and the system will boot again. If you see an error message, try the method below.
How to repair the EFI boot loader manually in Windows 10?
To restore the boot loader you will need either a Windows 10 distribution (bootable flash drive or disk) or a Windows 10 recovery disk.
The process of creating a bootable flash drive is described in detail in this article.
Step 1: Follow the first three steps from the previous point in this article to get to the “Advanced options” menu. After that select “Command Prompt”
Step 2: At the command prompt, type two commands in order (press Enter after each one to use them):
— to run the diskpart utility;
– – to display all the volumes on your computer;
Step 3: Select your hard disk, if there is only one, it is usually disk 0. To do this, enter the command:
sel disk 0
Step 4: Now you need to see what volumes are on the selected disk. To do this enter the command:
You will see a list of your partitions on the selected disk. The partition we will be looking for has a 100MB boot volume with a Fat32 file system.
In our case it is volume 3 – it is underlined in the picture below.
Step 5: Select the desired volume by entering the command:
select volume 3
— where 3 is the number of your drive, and press “Enter” to confirm.
Step 6: To work with volume further, assign a free drive letter to this volume, for example, “K”. To do this type the command:
assign letter K:
and press “Enter“. Then type”exit” and hit “Enter” again to exit diskpart (the command prompt will remain open)
Step 7: Go to the boot loader directory itself (K is the letter we allocated earlier). To do this at the command prompt, type:
cd /d K:\efi\microsoft\boot\
and hit “Enter”.
Step 8: Perform the command:
and press “Enter” to overwrite the boot sector.
Step 9: Just in case, let’s rename the old boot loader configuration. To do this type the command:
ren BCD BCD.bak
and press “Enter” again.
Step 10: To create a new bootloader configuration, type the command:
bcdboot C:\Windows /s K: /l en-en /f ALL
- “K” is the partition letter on which the operating system boot files are copied (we assigned it earlier)
- /l en-en is the language of your operating system;
- /f ALL in combination with the command /s indicates the type of firmware on the target system partition (“UEFI”, “BIOS” or “ALL”).
Step 11: Type “exit” and press “Enter” several times until the command prompt window closes. Once the command prompt is closed restart your computer.
Your EFI boot loader will be restored and your system should boot up again.
What to do if important data is lost due to incorrect EFI boot loader repairing?
Often users trying to repair a corrupted EFI boot loader perform manipulations that lead to loss of important data. For example, the user restored the bootloader to the wrong drive, or after restoring the EFI bootloader the system shows that the file system on the drive is corrupted.
In such a situation it is best not to act too hastily, and immediately use RS Partition Recovery — the professional data recovery program, as it significantly increases the chances of successful data recovery.
Also, RS Partition Recovery is excellent for the recovery of data that has been lost as a result of accidental fie deletion, formatting of a drive, file system corruptions, or as a result of damaged logical structure of a drive.
The program supports absolutely All file systems which are used in modern computers, it is not demanding to resources of the computer, and possesses the intuitive and clear interface thanks to what the recovery process is simple and does not cause difficulties even for inexperienced users.
If you have lost important information for any reason, you need to perform a few simple steps to recover it:
Step 1. Install and launch the RS Partition Recovery.
Step 2. Select the drive or partition from which you want to recover data.
Step 3. Choose the type of analysis.
Fast scan you should use in case the file was lost recently. The program will scan the drive quickly and show the files available for recovery.
The Full analysis function allows you to find lost data, after formatting, disc resizing, or file structure corruption (RAW).
Step 4. Preview and select the files to recover it.
Step 5. Add the files you want to save to the “Restore list” or select the entire partition and click Recovery.
It should be noted that it is best to save the recovered file to an external hard drive or USB flash drive.