TroubleChute Logo
WINDOWS RECOVERY

Restore EFI/Boot Partition (Recover or Recreate)


Published: Oct 2, 2022
Last Edit: Jan 12, 2023
Windows Boot
1,160 Words, 5 Minutes.

What is this partition

The EFI System Partition (ESP) is where files are stored for a UEFI firmware to load in order to start the Windows operating system. Without this partition: Windows simply won’t boot.

It’s not easy to delete or corrupt, but it can and does happen. Especially when it comes to migrating Windows from one drive to another without reinstalling it. When corruption or error occurs, or worse, it goes missing, a massive effort can go into fixing it.

The simplest solution? As it usually is: Hirens Boot CD (Or a Windows Recovery USB - The thing you install Windows from). We just need access to Windows files and a command prompt.

Downloading Hirens Boot CD

This is the method I recommend. You can use an existing Windows Installation USB (or get an existing one), plug it in, and start a Command Prompt from there… But Hirens allows you access to many other tools for recovering data, partitions, and more. You can even extract what you need for the day and forget about your PC for another day if that’s what should happen.

You will need access to another computer if you have neither Windows Installation Media or Hirens.

To download the Hirens Boot CD, head to the Download Page, and click HBCD_PE_x64.iso near the bottom of the page. A large ISO file will download (~2.8 GB).

Now you will need a tool to ‘burn’ the image to a USB. You can use the USB again after you’re done recovering Windows.

You can use RUFUS if you’re comfortable with it, or simply use the ISO2USB tool that Hirens offers.

Both will require you to select a USB, then an ISO, and click Start.

Before proceeding: Plug the USB you intend to use and copy ALL the data off it. It will be wiped to prepare to boot from it. You can restore data afterward.

Using Hirens ISO2USB

Download ISO2USB by clicking ISO2USB.exe. Then open the exe file.

Select the USB you plan to use (that should be empty!), then you should see a path leading to <something>...\HBCD_PE_x64.iso in the ISO File input box. If not, navigate to where the ISO we downloaded is, and drag and drop it into the text box. Now there should be a path here.

Click Process with both tickboxes checked, and wait for the process to complete. You may need to click Yes to proceed.

Boot from the Hirens USB

Now that we have a USB to boot from, we need to shut down our computer. We need to repair the EFI partition (if not already) and insert the USB we just burned.

Now, power it on again. You will need to spam all the keys between F1 and F4, as well as F12 and Delete. One of these keys will lead to your BIOS, where we can tell the PC to boot from the USB.

In the BIOS (You may need to refer to your manual): Head to the Boot section, and either move the USB we just burned to the top of the boot order list or select it to boot from it. This differs per your motherboard’s manufacturer. You may need to head to the Save or Exit tab and choose Save and Reset, Save and Continue, or a similar button.

Now your computer should reboot, and Hirens will start to load.

Delete the existing EFI Partition (Corrupt or already deleted)

If the EFI partition exists, we should delete it.

On Hirens, hit Start and head to Hard Disk Tools, then Partition Tools, and open EaseUS Partition Master - It’s the least limited of the free software included (as far as I can tell). Now open a File Explorer and see which drive has your Windows files on it. It is likely C:\ drive as it is in Windows, but this may be different. You should see a drive of the same size within EaseUS Partition Master and a Windows icon next to one of the partitions. Look for the EFI partition on the same drive (You will see EFI something on the far right), then select it. Right-Click and choose Delete. Now at the top, click the Play button to confirm our changes. Make sure you have deleted the right partition before this clicking confirm!

Now, we can recreate the EFI partition and copy the required files back onto it.

Restoring the EFI Partition

If you’re using Hirens, hit Start and open the Command Prompt.

Now that you’re in either the Windows Recovery environment and have opened a command prompt or in Hirens with a Command Prompt open, we can finally fix up the EFI partition.

Enter the following commands one by one:

1
2
diskpart
list disk

This opens the Diskpart tool and allows us to manage drives and partitions. We need to look for the correct size drive and note the number next to it. Check the File Explorer in Hirens to ensure we’re looking at the right one. Names for drives should also appear here. You should recognize the names of other drives, but the Windows drive does not have a name by default.

1
select disk X

Where X is your drive number

1
list partition

This command lets us double-check we’re on the correct drive.

Now, to create the EFI partition and restore data to it:

1
2
3
4
5
create partition efi
format quick fs=fat32
list partition
list volume
exit

list partition should show the new EFI partition. list volume should reveal the drive letter that Windows is assigned to. This should be C, but it could be different - especially under the Windows Recovery Environment.

Now we need to add files to the recovery partition.

Simply run:

1
bcdboot c:\windows

Where c is the correct drive letter again.

If you’re on Hirens, you can verify the existence of files by clicking back into EaseUS Partition Manager and clicking Yes when prompted about a refresh. If not, you’ll need to re-open it. You should now see the new EFI partition. Right-Click this partition and choose to Explore Files or a similar option. You should see some folders.

At this point: We can shut down the computer, unplug the USB and start it again.

The last step here is important (checking if the files exist), especially when there could be more than one OS on more than one drive. If so, you’ll need to add /s x, where X is the correct drive letter. For example: bcdboot c:\windows /s d

All done

You should now be able to boot into Windows once more. Previously with a corrupt EFI partition, you’ll see a BSOD right after POSTing and getting past the BIOS. It’s pretty instant. Without an EFI partition, you’ve likely seen the dreaded No OS found` screen or your motherboards equivalent.

Hopefully, this guide helped you as it did me… I spent hours trying many fixes to find the best out of them.

TCNO TechNobo / TroubleChute © Wesley Pyburn (TechNobo / TroubleChute)