Diskpart Force Delete Partition: Step-by-Step Guide
In this article
- What Is Diskpart and Why Use It?
- How Diskpart Deletes Partitions (Normal vs. Force)
- Step-by-Step: Force Delete a Partition with Diskpart
- When to Use “clean” Instead of “delete partition override”
- Common Problems and How to Fix Them
- Safety: Back Up Before You Force Delete
- Alternatives to Diskpart for Force Deleting Partitions
- Frequently Asked Questions
Yes, you can force delete a partition with Diskpart, a built-in Windows command-line tool, by using the clean command or the delete partition override command. This article explains exactly how to do it, what to do when the standard delete fails, and the risks involved.
What Is Diskpart and Why Use It?
Diskpart is a command-line disk partitioning utility included in Windows since XP. It lets you create, delete, merge, and format partitions on internal and external drives. Unlike the graphical Disk Management tool, Diskpart can often delete stubborn partitions that the GUI refuses to touch, such as OEM recovery partitions, EFI system partitions, or partitions with errors. It also works well for cleaning an entire disk quickly, which is useful before reinstalling Windows or repurposing a drive.
How Diskpart Deletes Partitions (Normal vs. Force)
Diskpart has two main ways to delete a partition:
- Standard delete:
delete partition– removes a partition but fails if the partition is protected, in use, or the system/boot partition. - Force delete:
delete partition override– bypasses some protection checks and can delete partitions that the standard command rejects.
However, delete partition override still cannot delete the system, boot, or pagefile partitions, nor a partition that is currently in use. For those, you need the clean command, which removes all partition structures from the disk, effectively force-deleting everything.
Step-by-Step: Force Delete a Partition with Diskpart
Follow these steps carefully. They work on Windows 10 and 11, and most older versions.
- Open Command Prompt as Administrator. Press Win + X and select “Terminal (Admin)” or “Command Prompt (Admin)”.
- Type
diskpartand press Enter. A new prompt appears. - List all disks:
list disk. Note the disk number of the drive containing the partition you want to delete. - Select the disk:
select disk X(replace X with the actual number). - List partitions:
list partition. Note the partition number. - Select the partition:
select partition Y(replace Y). - Try the standard delete first:
delete partition. If it succeeds, you are done. - If it fails with “Virtual Disk Service error: The partition is in use” or similar, use
delete partition override. - If that also fails (e.g., for system or boot partitions), you must clean the entire disk:
clean(this deletes all partitions).
When to Use “clean” Instead of “delete partition override”
The clean command is the true “force delete” for a whole disk. It removes all partition tables and makes the disk unallocated. Use it when:
- The partition is the system or boot partition (usually partition 1 or 2 on the C: drive).
- You want to wipe a USB drive or SD card that has hidden or protected partitions.
- The disk has multiple partitions and you want to start fresh.
- Diskpart reports “The disk is in use” or “The system cannot find the file specified” for every partition.
Note that clean deletes all partitions on the selected disk, not just one. If you need to keep other partitions, back them up first or use a third-party tool.
Common Problems and How to Fix Them
Diskpart can throw several errors. Here are the most common and what they mean:
- “Virtual Disk Service error: The partition is in use.” – Close any programs that might be using the drive (e.g., File Explorer, antivirus scans). If it’s an external drive, safely eject and reconnect.
- “The disk is in use or locked.” – Often happens with external drives. Run
cleaninstead, or use theattributes disk clear readonlycommand first if the disk is read-only. - “Access is denied.” – Make sure you ran Command Prompt as Administrator. Also check if the drive is protected by BitLocker or has a write-protect switch.
- “The system cannot find the file specified.” – This can happen if the partition is corrupted. Try
cleanor use thedetail diskcommand to see if the disk is visible. - “Delete is not allowed on the current boot, system, pagefile, crashdump or hibernation volume.” – You cannot delete the partition Windows is running from. Boot from a Windows installation USB and use Diskpart from there, or use
cleanon the disk (but that will also remove Windows).
Safety: Back Up Before You Force Delete
Force-deleting a partition is destructive. Once a partition is deleted, the data on it is no longer accessible through normal means. While data recovery tools might recover some files, there is no guarantee. Always back up any important data to another drive before running any delete or clean command.
Also double-check that you selected the correct disk. A common mistake is selecting the wrong disk number, especially when multiple drives are connected. Use list disk and note the size of each disk to avoid wiping your main system drive.
Alternatives to Diskpart for Force Deleting Partitions
If Diskpart fails or you prefer a graphical interface, these are reliable alternatives:
- Disk Management (diskmgmt.msc) – Right-click the partition and select “Delete Volume”. It fails on system partitions, but works for most others.
- Windows PowerShell – Use
Remove-Partition -DriveLetter XorClear-Disk -Number X -RemoveDatafor a clean. These are similar to Diskpart but with different syntax. - Third-party partition managers – Tools like MiniTool Partition Wizard, EaseUS Partition Master, or GParted (Linux) can often delete partitions that Diskpart cannot, and they offer a GUI.
- Windows Installation Media – Boot from a Windows USB, press Shift+F10 to open Command Prompt, and run Diskpart there. This bypasses the “in use” issue because Windows isn’t running from the drive.
Frequently Asked Questions
Will deleting a partition with Diskpart erase the data?
Yes, deleting a partition removes the partition table entry, making the data inaccessible. The data is not physically overwritten, so recovery tools might recover some files, but it’s not guaranteed. Back up first.
Can I force delete the C: drive partition?
No, not while Windows is running from it. You must boot from installation media and use Diskpart from there. Alternatively, you can use clean on the disk, but that will delete all partitions including the system one.
What is the difference between “delete partition” and “delete partition override”?
The override flag tells Diskpart to bypass certain checks, such as the “partition is in use” error. However, it still cannot delete system, boot, or pagefile partitions. For those, you need clean.
Does “clean” work on a disk that has a write-protect switch?
No. If the disk is physically write-protected (e.g., a microSD adapter), you must remove the switch. If it’s software write-protected, use attributes disk clear readonly in Diskpart first.
Can I recover data after a force delete?
Possibly, using data recovery software like Recuva or TestDisk. The sooner you stop using the drive, the better the chance. However, there’s no guarantee, so always back up.
Why does Diskpart say “The disk is in use” for an external drive?
This often happens because File Explorer or an antivirus is scanning the drive. Close all windows and programs that might access the drive, then try again. If it persists, use clean instead.