This tutorial will show you how to clean (wipe) a disk drive to remove all partition (volume) formatting information on it to un-initialize and erase all data on the disk in Windows 10 and Windows 11.
When you clean a disk, the disk will show as "Unknown" and "Not Initialized" with "Unallocated" space afterwards. This will be a completely wiped out RAW disk ready to be initialized and create a new partition (volume) on the disk. Clean is a good option to quickly wipe and start fresh on a disk.
You can clean all a disk instead of clean to also secure erase the disk. Clean all specifies that each and every sector on the disk is set to zero, which completely deletes all data contained on the disk. It can take about an hour per 320 GB to finish running the "clean all" command on a disk. Clean all would be a good option to use before selling or trashing a disk.
References:
clean
Reference article for the Diskpart clean command, which removes all partitions or volume formatting from the disk with focus.
learn.microsoft.com
Clear-Disk (Storage)
Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell.
learn.microsoft.com
You must be signed in as an administrator to "clean" or "clean all" a disk.
Contents
- Option One: "Clean" or "Clean all" a Disk in Command Prompt
- Option Two: "Clean" a Disk in PowerShell
EXAMPLE: "Unknown" and "Not Initialized" Disk with "Unallocated" space after "Clean" or "Clean all"
1 Open Windows Terminal (Admin), and select Command Prompt.
2 Copy and paste the command below into Windows Terminal (Admin), and press Enter. (see screenshot below step 4)
diskpart
3 Copy and paste the command below into Windows Terminal (Admin), and press Enter. (see screenshot below step 4)
list disk
4 Make note of the Disk number (ex: "2") of the disk you want to "clean" or "clean all". (see screenshot below)
5 Type the command below into Windows Terminal (Admin), and press Enter. (see screenshot below)
select disk <number>
Substitute <number> in the command above with the actual disk number (ex: "2") you want to wipe from step 4 above.
For example: select disk 2
Be sure you use the correct disk number since this disk will be completely wiped making data on it unrecoverable.
6 Copy and paste the command below you want to use into Windows Terminal (Admin), and press Enter. (see screenshot below)
(Quickly clean disk)
>
clean
OR
(Clean and secure erase disk)
It can take about an hour per 320 GB to finish running the "clean all" command on a disk.
>
clean all
7 When finished, you can close Windows Terminal (Admin) if you like.
1 Open Windows Terminal (Admin), and select Windows PowerShell.
2 Copy and paste the command below into Windows Terminal (Admin), and press Enter. (see screenshot below step 3)
Get-Disk
3 Make note of the disk Number (ex: "2") of the disk you want to "clean". (see screenshot below)
4 Type the command below into Windows Terminal (Admin), and press Enter. (see screenshot below)
Clear-Disk -Number <DiskNumber> -RemoveData -RemoveOEM -Confirm:$false
Substitute <DiskNumber> in the command above with the actual disk number (ex: "2") you want to wipe from step 3.
For example: Clear-Disk -Number 2 -RemoveData -RemoveOEM -Confirm:$false
Be sure you use the correct disk number since this disk will be completely wiped making data on it unrecoverable.
5 When finished, you can close Windows Terminal (Admin) if you like.
That's it,
Shawn Brink
Last edited: