How To Erase Partition | DiskPart & Disk Mgmt

Erasing a partition in Windows depends on the partition type: use Disk Management for simple volumes, DiskPart for protected ones.

One wrong click in Disk Management and a partition is gone, permanently. Whether you are reclaiming space, wiping a drive for resale, or prepping for a clean install of Windows, knowing how to erase a partition safely is an essential skill. This guide covers the three official tools built into Windows—Disk Management, DiskPart, and the Windows Setup environment—along with the exact commands and the critical safety checks that prevent accidental data loss.

The method you choose matters. A secondary data volume deletes easily in the graphical tool. A protected OEM or recovery partition requires the command-line override flag. And a full drive wipe calls for DiskPart’s clean or clean all command. Below are the step-by-step procedures for each scenario, starting with the safest route and moving to the most powerful.

Erasing A Partition In Disk Management: The Standard Route

Disk Management is the safest graphical tool for erasing simple partitions on secondary internal or external drives. It does not require memorizing commands, but it cannot delete the active system partition or some protected OEM volumes.

  1. Press Windows Key + X and select Disk Management.
  2. Right-click the volume or partition you want to remove and choose Delete Volume.
  3. Confirm the warning that all data on the partition will be erased.
  4. The space now appears as Unallocated and is ready to use for a new partition or extension.

This method fails if the partition is the active system drive, contains the pagefile, or is a protected recovery partition. In those cases, you need DiskPart.

Using DiskPart For Stubborn Or Protected Partitions

DiskPart is the command-line utility that can force-delete any partition, including those that refuse to be removed in Disk Management. The delete partition override flag handles protected entries, while the clean command wipes the entire disk’s partition table.

Delete a Single Partition With Override

  1. Open Command Prompt as Administrator (run cmd as admin).
  2. Type diskpart and press Enter.
  3. Type list disk and identify your target disk’s number by its size.
  4. Type select disk X (replace X with the correct number).
  5. Type list partition and note the partition number you want to delete.
  6. Type select partition Y (replace Y with the correct number).
  7. Type delete partition override and press Enter.
  8. Type exit to close DiskPart.

Wipe The Entire Drive With Clean

  1. Open Command Prompt as Administrator and launch diskpart.
  2. Type list disk and verify the correct disk number.
  3. Type select disk X.
  4. Type clean (removes all partition entries) or clean all (overwrites every sector for secure wiping).
  5. Type exit.

After clean, the disk shows as Unallocated in Disk Management. After clean all, every sector is zeroed out—this takes much longer on large drives. TechTarget’s complete DiskPart walkthrough defines the exact behavior of each command.

Why Can’t I Delete This Partition? Common Stumbling Blocks

Protected partitions, the active system drive, and simple user errors are the three most common reasons a deletion fails. Here is how to identify and handle each one.

Blockage Why It Happens Workaround
Protected / OEM partition Windows locks system and recovery partitions to prevent accidental damage. Use DiskPart’s delete partition override command.
Active system or boot drive The OS cannot delete the partition it is currently running from. Boot from Windows Setup media or WinRE to delete it.
Wrong disk selected A single digit mistake in DiskPart can target the wrong drive. Double-check the disk size in list disk before selecting.
No backup performed Data loss is immediate once the partition is deleted. Always back up files before starting.

If the partition hosts the pagefile or crash dump, Disk Management may block the deletion. The override flag in DiskPart bypasses this.

Erasing All Partitions During A Windows Clean Install

If you are reinstalling Windows, the Setup environment can delete every partition on the target drive right before installation. This is the cleanest way to start fresh with a single unallocated space.

  1. Boot from Windows 10 or 11 installation media.
  2. Click Next on the language screen, then Install Now.
  3. Choose Custom: Install Windows only (Advanced).
  4. Select each partition on Drive 0 one at a time and click Delete.
  5. After all partitions on that drive are deleted, you will see Drive 0 Unallocated Space.
  6. Select the unallocated space and click Next. Windows will create the necessary system partitions and install.

Important: Only delete partitions on the drive where you intend to install Windows. Microsoft notes that it is unnecessary to delete partitions on secondary drives. Deleting partitions during setup removes the existing layout and clears BitLocker protection if it is active.

Method Best Use Case Complexity Destructiveness
Disk Management Simple volumes on secondary or external drives Low Low (removes partition table entry)
DiskPart (override) Protected, OEM, or stubborn partitions Medium Medium
DiskPart (clean / clean all) Wiping the entire disk or clean all for secure erase Medium High (wipes entire disk data)
Windows Setup Preparing a drive for a fresh OS installation Low Medium (deletes partitions on target drive only)

Final Decision Guide For Erasing Partitions

Choose your method based on the partition’s type and your goal. For a secondary data volume, Disk Management is the fastest path that avoids the command line. When the system refuses to delete a protected partition, switch to DiskPart with the override flag. If your goal is a clean install of Windows, use the Setup tool’s Delete button on each partition of the target drive.

  1. Back up first. Data loss is immediate and permanent. Verify the backup before proceeding to the next step.
  2. Identify the drive. Use Disk Management to confirm the disk number and partition layout before using DiskPart.
  3. Select the method. GUI (Disk Management) for simple volumes, CLI (DiskPart) for protected ones, Setup for clean installs.
  4. Execute the exact command. One wrong digit in DiskPart wipes the wrong drive. Type carefully.
  5. Verify the result. The freed space should appear as Unallocated in Disk Management before you create a new partition or install Windows.

References & Sources