If you have ever taken an older hard drive or SSD that previously had Windows installed on it and plugged it into your PC as a secondary storage drive, you have probably run into one of Windows’ most frustrating roadblocks.
You open Disk Management to wipe the drive and reclaim all your space, only to find a 512 MB EFI System Partition sitting at the front of the disk—and when you right-click it, Delete Volume is completely grayed out.
Windows locks EFI and recovery partitions by default so users don’t accidentally render their active operating system unbootable. That safety net is great for your main C: drive, but annoying when you are simply trying to set up a clean secondary storage drive.
To bypass that restriction, you need to delete EFI partition using DiskPart, Windows’ built-in command-line disk utility. Below is the exact, step-by-step terminal workflow I just used to strip a protected 512 MB EFI partition off a 1 TB drive, wipe it clean, initialize it as GPT, and format it as a fresh NTFS storage volume.
Before You Start: Back Up and Double-Check Your Disk Numbers
DiskPart does not have an “Undo” button or a Recycle Bin. Once you execute a delete or clean command, the partition table on that disk is gone immediately.
Before running any destructive command, always cross-check both list disk and list volume so you are 100% sure you aren’t targeting your active Windows drive (C:) or another active storage disk.
Step 1: Open Command Prompt as Administrator and Launch DiskPart
- Press the Windows Key, type
cmd, right-click Command Prompt, and select Run as administrator. - Type the following command and press Enter:
DOS
diskpart
Once the prompt changes from C:\Windows\System32> to DISKPART>, you are ready to inspect your drives.
Step 2: Identify the Exact Drive You Want to Modify
Run these two commands to see every physical drive and every mounted drive letter on your system:
DOS
list disk
list volume
You will see an output similar to this:
Plaintext
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 931 GB 1024 KB * *
Disk 1 Online 465 GB 1024 KB *
Disk 2 Online 931 GB 1024 KB *
Look closely at the sizes and cross-reference them with list volume:
- In a multi-drive setup, Disk 1 (465 GB) might hold your
C:Windows boot partition. - Disk 0 (931 GB) might already be split into active
D:andE:data volumes. - Disk 2 (931 GB) is our target storage drive containing the unwanted
512 MBEFI partition and primary partition.
Select your target disk (replace 2 with your actual target disk number):
DOS
select disk 2
Now list the partitions specifically on that selected disk to confirm the layout:
DOS
list partition

Step 3: Delete EFI Partition Using DiskPart (override)
If you only want to remove the protected 512 MB System (EFI) partition without wiping the rest of the drive, select Partition 1 and force-delete it using the override flag:
DOS
select partition 1
delete partition override
DiskPart will respond with:
DiskPart successfully deleted the selected partition.
The override parameter tells DiskPart to bypass Windows’ standard protection lock on system and hidden partitions. If you want to keep your existing data on Partition 2, you can stop here, type exit, and extend your main partition in Disk Management.
Step 4: Wipe the Entire Drive Clean and Convert to GPT (Optional Full Reset)
If you are setting up the drive from scratch—like dedicating a 1 TB drive exclusively as a clean project or media disk—it is much cleaner to wipe the entire partition table and rebuild a single partition from the command line rather than merging leftover fragments.
(Warning: The clean command erases all partitions and data on the selected disk.)
With your target disk still selected (select disk 2), run the following sequence one line at a time:
DOS
clean
convert gpt
create partition primary
format fs=ntfs quick label="Project HDD"
assign letter=G
Here is what each command does under the hood:
clean: Wipes all existing partition records and hidden boot sectors from the selected disk.convert gpt: Initializes the disk using the modern GUID Partition Table (GPT) standard, which supports drives larger than 2 TB and avoids legacy MBR limits.create partition primary: Allocates 100% of the unallocated space into one clean primary partition.format fs=ntfs quick label="Project HDD": Performs a fast NTFS format and gives the drive a custom name (replace"Project HDD"with whatever label you prefer).assign letter=G: Mounts the formatted volume to drive letterG:(or any unused letter you choose) so it immediately appears in File Explorer.
Step 5: Exit DiskPart
Once DiskPart confirms the drive letter has been assigned, type exit to close the utility and return to the standard Command Prompt:
DOS
exit
Open File Explorer (Win + E), and your newly formatted drive will be ready to use with its full capacity available and zero leftover EFI partitions.
3 Common DiskPart Mistakes to Watch Out For
Working inside a command-line utility is fast, but DiskPart is picky about syntax and context. If you hit a wall, it is usually one of these three things:
- “There is no disk selected to list partitions”: You cannot run
list partitionimmediately after opening DiskPart. You must runlist diskandselect disk Xfirst so DiskPart knows which physical drive you are inspecting. - DiskPart prints a command help list instead of deleting: This happens for two reasons—either you forgot to run
select partition Xbefore runningdelete partition override, or there is a typo in the command (for example, typingpertitioninstead ofpartition). Anytime DiskPart doesn’t recognize a keyword, it prints the command syntax guide instead of executing the action. - Deleting a partition on a Dynamic disk: If your
list diskoutput shows an asterisk (*) under the Dyn column, the disk is configured as a Dynamic disk rather than a Basic disk. Standarddelete partitioncommands behave differently on dynamic volumes—convert or back up your data before modifying dynamic disks.