Skip to content

Instantly share code, notes, and snippets.

@csivanich
Last active November 28, 2023 17:13
Show Gist options
  • Save csivanich/5d836e93233fd2890c051f967e075a1c to your computer and use it in GitHub Desktop.
Save csivanich/5d836e93233fd2890c051f967e075a1c to your computer and use it in GitHub Desktop.
Fix or Move Windows 10 EFI Partition/Bootloader

Windows 10 EFI Partition Fix/Move Steps

Create new EFI partition with parted

I did this with GParted, so it's psudocode

Create vfat32 partition
Give `boot/efi` flags

Create new EFI partition with diskpart

Creating EFI Partition

Protip: physically disconnect all other disks during these steps to minimize the chance of mis-locating or breaking things

On a Windows install/recovery disk

diskpart
list disk
select disk n # n refers to the disk to contain the EFI System partition
list partition
create partition efi
format quick fs=fat32
list partition
exit

Copy EFI data to partition

Installing EFI Data

diskpart
list volume # find the volume letter which belongs to the installed Windows OS
exit
bcdboot c:\windows \v \f UEFI # c refers to the volume letter of installed Windows OS

If that fails being unable to find the system partition, you need to temporarily assign a drive letter to the EFI partition:

diskpart
select vol n # n being the EFI partition
assign e # assigning e:\ - you may omit or use something else
exit

Now run bcdboot with specifying the system partition:

bcdboot c:\windows \v \f UEFI \s E:

You should see lots of text scroll, including some missing files (it's OK). The last line should mark it successful. Now remove the letter assigned to EFI partition, since it's not needed:

diskpart
select vol n # n being the EFI partition
remove e
exit

From here, you should have a new EFI partition rebuilt for the disk layout specified. Give it a reboot and you should see the Windows entry on the disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment