With GPT disks and UEFI all the rage now, it’s not uncommon to encounter a scenario where boot parameters need to be repaired in order to reach the operating system. Generally speaking, it’s often easy enough to accomplish this by executing the command bcdboot X:\windows (where X is the system drive letter) from a recovery environment.
However, other times, even in spite of this command properly completing, the system still will not boot. In many cases the failure is evident when attempting to perform bcdedit /enum and receiving a message such as this one:
The boot configuration data store can not be opened.
The requested system device cannot be found.
Performing bootrec /fixboot also provokes the following error:
Element not found
This is bad news on a GPT disk using UEFI rather than BIOS. Essentially, the system is looking for the EFI partition, which in this case is either missing or corrupt.
If it’s corrupt but still exists, you can simply enter diskpart, select the system partition (usually around 500 MB in size and with an ID of “EFI”) and assign it a letter, exit diskpart, and then perform a chkdsk command on the new partition assignment. This sometimes will correct it. Other times, forcibly removing the EFI and boot folders from the EFI partition and then executing the bcdboot command with a specific system partition parameter (e.g.: bcdboot X:\windows /s E:, where X: is the Windows partition and E: is the EFI paritition) works.
But let’s say the partition is missing altogether. This is most often the case following a drive image using imaging tools to a new SSD for example. Sometimes the tools (especially if executed externally on another system rather than live within the target OS) will remove the EFI partition and only image the Windows partition.
If this happens, most people will tell you that you will need to reinstall Windows from scratch. However, all is not yet lost! It’s fixable — but in order to accomplish it, you must recreate the EFI partition manually and then reload the boot parameters from there.
Here’s how it’s done at a command prompt from a recovery environment. I’ve bolded the commands I typed to make it easier to read — hold on tight:
X:\windows\system32>diskpart
Microsoft DiskPart version 10.0.10240
Copyright (C) 1999-2013 Microsoft Corporation.
On computer: MININT-3A416N9
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
——– ————- ——- ——- — —
Disk 0 Online 489 GB 0 B *
DISKPART> sel disk 0
Disk 0 is now the selected disk.
DISKPART> list part
Partition ### Type Size Offset
————- —————- ——- ——-
Partition 1 Primary 489 GB 1024 KB
DISKPART> sel part 1
Partition 1 is now the selected partition.
DISKPART> shrink desired=1024
DiskPart successfully shrunk the volume by: 1024 MB
DISKPART> create partition efi size=260
DiskPart succeeded in creating the specified partition.
DISKPART> format quick fs=fat32
100 percent completed
DiskPart successfully formatted the volume.
DISKPART> exit
Leaving DiskPart…
X:\windows\system32>bcdboot c:\windows
Boot files successfully created.
Following these steps, the machine should now be bootable. If it’s not, it’s probably time to call a professional!
Good luck!