Deleting a partition using DiskPart in Windows permanently removes the partition and all data on it, freeing up space for new volumes. You must run DiskPart as Administrator and ensure you select the correct disk and partition—mistakes here can destroy system data. No additional tools are required beyond a Windows PC with administrative access.
What You'll Need
- A Windows PC (Windows 7, 8, 10, or 11)
- Administrative privileges on the computer
- A backup of any important data on the partition you intend to delete (critical—deletion is irreversible)
- Physical or logical access to the target disk (internal/external HDD or SSD)
Step-by-Step
- Press Windows + R to open the Run dialog, type
cmd, then press Ctrl + Shift + Enter to open Command Prompt as Administrator. Confirm User Account Control if prompted. - In the elevated Command Prompt window, type
diskpartand press Enter. The DiskPart utility starts and displays theDISKPART>prompt. - Type
list diskand press Enter. This shows all physical disks attached to the system, including their size and status. Note the disk number of the drive containing the partition you want to delete (e.g., Disk 0, Disk 1). - Type
select disk X(replaceXwith the correct disk number from Step 3) and press Enter. Verify the correct disk is selected by checking the confirmation message (e.g., "Disk 1 is now the selected disk"). - Type
list partitionand press Enter. This lists all partitions on the selected disk. Identify the partition number you intend to delete (e.g., Partition 2, often labeled as the drive letter like D: or E: in Windows Explorer). - Type
select partition Y(replaceYwith the partition number from Step 5) and press Enter. Confirm the selection with the message "Partition Y is now the selected partition."/li> - Type
delete partition overrideand press Enter. Theoverridekeyword is required for system or recovery partitions, and ensures deletion proceeds even if Windows considers the partition protected. If the partition is not protected, you may omitoverride, but including it prevents errors. - Type
exitand press Enter to leave DiskPart, then close the Command Prompt window.
Common Mistakes
- Selecting the wrong disk or partition: DiskPart does not warn you twice—once you delete, the data is gone. Always double-check
list diskandlist partitionoutputs before selecting. - Running DiskPart without admin rights: Non-administrative Command Prompt windows cannot execute DiskPart commands. You’ll see access denied errors.
- Forgetting
overrideon protected partitions: System, recovery, or OEM partitions often require theoverrideswitch. Omitting it results in "Error: The system cannot find the file specified" or "Access is denied."/li> - Deleting the wrong drive letter: Drive letters can change (e.g., after plugging in a USB drive). Always match by partition number and size, not drive letter.
- Deleting the system or EFI partition: This can render Windows unbootable. Only delete partitions you are certain are non-essential (e.g., a data partition on a secondary drive).
Tips
- Use
detail partitionafter selecting a partition to view its type (e.g., Primary, Logical), size, and offset—this helps confirm you have the right one. - Before deleting, use
cleanon a disk only if you want to wipe the entire disk (not just one partition)—this removes the partition table and all data. - If you need to delete a partition and extend a neighboring one, select the partition you want to keep, then use
extendafter deletion to reclaim unallocated space. - Run
list volumein DiskPart to see drive letters and volume labels alongside partition details—this cross-references Windows Explorer names. - For external drives, disconnect and reconnect the device if DiskPart doesn’t detect it; sometimes USB enumeration lags in DiskPart.
Troubleshooting
If deletion fails, try these steps in order:
- Restart and retry: Close all programs, restart your PC, and repeat the steps. A locked file or process (e.g., a background backup service) can prevent deletion.
- Check for open handles: In Command Prompt (admin), run
handle -p [process_name](with Sysinternals Handle tool) to see if any process is using the partition. End the process if safe to do so. - Use Disk Management instead: Open
diskmgmt.msc, right-click the partition, and choose Delete Volume. If it fails here too, the partition may be locked by the OS (e.g., the system reserved partition). - Boot into Safe Mode: Restart while holding Shift, go to Troubleshoot > Advanced Options > Startup Settings > Restart, then press F4 to boot into Safe Mode. Run DiskPart again—fewer background processes reduce conflicts.
- Use
forceoverridecarefully: As a last resort, after backing up critical data, trydelete volume override(note: usevolumefor logical volumes,partitionfor partitions—interchangeable in modern Windows but not always). Avoidforceunless instructed by official Microsoft docs.
If none work, the disk may be dynamic (not basic). Convert to basic disk only if no important data exists: in DiskPart, use convert basic after selecting the disk—but this deletes all data on the disk first.
Frequently Asked Questions
Can I undo a partition deletion with DiskPart?
No. DiskPart deletion is permanent and bypasses the Recycle Bin. Recovery requires third-party tools (e.g., Recuva or TestDisk), but success isn’t guaranteed—stop using the disk immediately after accidental deletion to maximize recovery chances.
Will deleting a partition delete Windows?
Only if you delete the system, boot, or recovery partitions on the main drive. Normal data partitions (e.g., D:) or partitions on secondary drives won’t affect Windows operation.
Why does DiskPart say "Access is denied" when I try to delete?
This usually means the partition is protected (e.g., system or OEM). Add override to the command: delete partition override. Ensure you’re in an elevated Command Prompt.
Can I delete a partition without losing data?
No. Deletion removes the partition table entry and all data. Always back up first. To resize safely instead of delete, use Disk Management or third-party tools like MiniTool Partition Wizard— DiskPart itself cannot shrink a partition without data loss risk if not prepared.
Does deleting a partition free up space automatically?
Yes. After deletion, the space becomes "Unallocated" in Disk Management. You can then right-click an adjacent partition and choose Extend Volume to absorb the freed space.
Is DiskPart safe for SSDs?
Yes—deletion works the same as on HDDs. However, SSDs don’t require secure erase via DiskPart for normal use; TRIM handles optimization. Only use clean /all for full SSD wiping if selling or reusing the drive.