Skip to content
GEEKnodes

Windows · Updated on

Delete All Partitions on a Disk in Windows with Diskpart

Delete every partition on a disk in Windows 10 and 11 with diskpart clean or clean all, including EFI and recovery, and make it ready to use.

Windows Disk Management will not delete some partitions, such as EFI, recovery or the ones PC makers create. When you want a completely clean disk (to reuse it, sell it or install a system from scratch), the direct way is diskpart, the command-line utility included with Windows 10 and Windows 11. Its clean command removes all partitions and the partition table at once.

Disk with EFI, primary, recovery and OEM partitions before clean; afterwards it has no partitions, although the data remains.
clean deletes the partition structure but does not overwrite the data on the disk.

Warning: this erases the whole selected disk, with no Recycle Bin and no confirmation. Diskpart does not ask “are you sure?”. Pick the wrong disk number and you lose that disk’s data. Read all the steps before starting and check the disk at least twice.

Before you start

  • Back up everything you want to keep from the disk. After clean, specialized software may recover something; after clean all, nothing.
  • Disconnect disks you will not touch (USB drives, SD cards, second disks) whenever possible. Fewer disks listed, fewer chances to err.
  • You need an administrator console.
  • To wipe the disk Windows is installed on, you cannot do it from that same Windows. Boot from a Windows installation USB and, on the first screen, press Shift + F10 to open Command Prompt.
  • If the disk is BitLocker encrypted, make sure you need nothing from it: after clean the recovery key is useless.

Step 1: open diskpart

In Windows, right-click Start, choose Terminal (Admin) (Windows 11) or Windows PowerShell (Admin) (Windows 10) and type:

diskpart

The prompt changes to DISKPART>. From here, all commands go into it.

Step 2: identify the right disk

List the disks:

Three disks of 256 GB, 1 TB and 64 GB; the 1 TB one is selected and the 256 GB one, holding C:, is crossed out.
Identify the disk by size; if you see C:, it is not the one you want to wipe.
list disk

You see a table with Disk ###, Status, Size, Free and Gpt. Watch size above all: it is the most reliable clue. If in doubt, select one and view its detail:

select disk 1
detail disk

detail disk shows model and volumes with letter and label. If you see letter C: and did not mean to wipe Windows, that is not your disk.

Step 3: select the disk

Once sure of the number, select it (replace 1 with yours):

select disk 1

Diskpart replies “Disk 1 is now the selected disk”. Run list disk again: the selected disk is marked with an asterisk (*). Check one last time.

Step 4: delete the partitions

You have two options:

Comparison: clean removes the structure and leaves recoverable data; clean all zeroes every sector.
clean is fast; clean all overwrites every sector and can take hours.
clean

clean removes all partitions and disk formatting. Per Microsoft, on MBR disks it overwrites the MBR partitioning and hidden sector information; on GPT disks it overwrites the GPT partitioning information, including the protective MBR. It is almost instant, but data stays physically on the disk until overwritten.

clean all

clean all zeroes every sector, fully erasing data. Use it if selling or giving away a mechanical hard drive (HDD). It can take many hours on large disks: do not interrupt it.

On an SSD, clean all also works, but writes the whole disk, takes time and adds wear. To securely erase an SSD, prefer the Secure Erase feature in the SSD maker’s official tool.

If you prefer PowerShell, the equivalent of clean is Clear-Disk (replace 1 with your disk number):

Clear-Disk -Number 1 -RemoveData -RemoveOEM

PowerShell does ask for confirmation before erasing.

Step 5: make the disk usable

A freshly cleaned disk has no partitions and does not show in File Explorer. If you are not installing Windows on it (setup creates its own), create a partition. Continue in DISKPART> with the disk still selected:

convert gpt
create partition primary
format fs=ntfs label="Data" quick
assign
exit
  • convert gpt uses the GPT scheme, recommended for current UEFI PCs. For a disk that must work in very old PCs, use convert mbr.
  • If it will also be used on a Mac or TV, format with fs=exfat instead of NTFS.
  • assign gives it a free drive letter.

You can also do this step from Disk Management (right-click Start): it asks to initialize the disk and then you can create a New Simple Volume.

Check it works

Before step 5, with the disk selected:

list partition

Diskpart should reply there are no partitions to show. After step 5, list volume shows the new volume with its letter, and the disk appears in File Explorer.

Common problems

“The media is write protected” / “The disk is write protected”. Clear the read-only attribute and retry:

attributes disk clear readonly

If it is an SD card or USB with a physical lock switch, move it first.

“Cannot clean the system disk” or an error cleaning the Windows disk. You cannot wipe the disk Windows is running from. Boot from install USB and use Shift + F10.

The disk shows “Offline”. Bring it online before cleaning:

online disk

Access error or “Virtual Disk Service error”. Check the console is administrator and close programs using the disk (backups, antivirus scanning, an Explorer window on it). For USB disks, try another port or cable.

clean all seems “stuck”. It is not frozen: it works without progress. On a multi-terabyte mechanical disk, hours are normal.

Frequently asked questions

Can I recover data after clean? Sometimes, with recovery software, since clean only removes the partition structure. After clean all, no.

Does it remove the maker’s recovery partition? Yes. Diskpart deletes all partitions, including protected ones Disk Management will not remove.

How is it different from formatting? Formatting works on one partition. clean removes all partitions and the disk’s partition table.

Accessibility preferences

Quick profiles

Text and reading

Text size
Default
Line height
Default
Letter spacing
Default
Word spacing
Default

Colour

Motion and orientation

Cursor