How to Fix the EFI Boot Partition’s ID Using DiskPart

Each partition type is strictly identified by a GUID number. For example, the data partitions (“Basic data partition”) are identified by the GUID ebd0a0a2-b9e5-4433-87c0-68b6b72699c7. The EFI partition has the GUID c12a7328-f81f-11d2-ba4b-00a0c93ec93b.

However, on some systems, the EFI partition may have an incorrect ID assigned for unknown reasons. As a result, the EFI partition may appear as a “basic data partition” when you open Disk Management.

fix EFI partition id using diskpart's set id command.
The EFI partition shows up as “Basic Data Partition.”

As you can see, the EFI partition appears as a “Basic Data Partition” whereas it should appear as “EFI System Partition“.

Windows updates and feature updates may fail to install due to the incorrect ID assigned for the EFI partition. Also, the bcdedit command may fail to run, and the Boot Configuration Data (BCD) may be inaccessible during setup. You may also see the following error when installing or upgrading to Windows 10 or 11.

Sorry, we're having trouble determining if your PC can run Windows 10. Please close Setup and try again.

Cause

The above happens because the EFI partition’s GUID is incorrect; it has been assigned the Basic data partition’s GUID (ebd0a0a2-b9e5-4433-87c0-68b6b72699c7)

Fixing the EFI’s ID using the Diskpart’s Set ID command resolves the issue.

Resolution

To fix the EFI partition’s identifier (GUID), open an admin Command Prompt window and run the following commands:

diskpart

list vol

The output shows the list of volumes. We must select the EFI partition, which is always a FAT32 partition.

Note: If there are multiple EFI partitions listed, especially on systems with multiple hard disks and dual OS installations, be sure to choose the correct EFI partition by using the combination of commands “select disk #” and “list part”. Or, select the EFI partition from the list that has the description “System” adjacent to it — i.e., under the “Info” column in the output.

The volume number of the EFI partition in this example is “Volume 0”. In this example, it’s of size 100 MB.

fix EFI partition id using diskpart's set id command.

So, type the following command:

select volume 0

(This selects the EFI partition. You should see the message “Volume 0 is the selected volume.”)

Next, to set the correct ID for the selected volume, type the following command:

set id=c12a7328-f81f-11d2-ba4b-00a0c93ec93b override

You should see the following output:

DiskPart successfully set the partition ID.

Next, type the following command to fix the gpt attributes for the volume.



gpt attributes=0x8000000000000000

(The attribute 0x8000000000000000 ensures that Windows won’t assign a drive letter for the partition.)

Type Exit to quit the DiskPart environment.

Type Exit to quit the Command Prompt.

Now, open Disk Management to see if the EFI partition’s ID has been fixed. It should read “EFI System Partition” instead of “Basic Data Partition.”

fix EFI partition id using diskpart's set id command.

We have successfully fixed the EFI partition’s ID.

Related articles

set id (Diskpart) | Microsoft Learn

GUID Partition Table – Wikipedia

EFI System Partition Appears in Explorer

How to Rebuild the EFI Boot Partition, BCD and Boot Files


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

Leave a Comment