31 Jan

EFI partition corrupted

Resized EFI partition today, and failed to enter windows. I got this error message:

the boot configuration data for your pc is missing or contains errors

I tried several methods to repair it but none of them helps. Then I realized that the EFI partition may be corrupted.
So, I deleted the EFI partition completely and regenerated one with the tutorial here by genet.
The steps are as follows:

first, make sure you have an unallocated space for EFI and allocate other unused space.
Boot with a windows installation media and enter the command prompt
run the following commands to create EFI partition:

diskpart
list disk #note the disk number where you are going to create EFI
select disk n # n is the number you got from the previous command
list partition #you can see that there is no efi partition yet
create partition efi
format quick fs=fat32
list partition #you can see your new efi partition now
list volume #note the volume letter where your windows is installed
exit

Now, run the following commands to generate boot datas to EFI partition:

bcdboot X:\windows # n is the letter you got from the previous command

Reboot the computer now and you should be able to enter your windows