How to Use Diskpart to Clean a Drive in Windows 11
The Diskpart command-line utility in Windows 11 allows users to completely clean or securely wipe internal hard drives, SSDs, and external storage devices. This guide provides a straightforward walkthrough on launching Diskpart, selecting the correct storage drive, and executing either a standard clean to remove partition configurations or a full wipe to permanently erase all data.
Step 1: Open Command Prompt as Administrator
- Press the Windows Key + S and type
cmd. - Right-click Command Prompt in the search results and select Run as administrator.
- Click Yes if prompted by User Account Control (UAC).
Step 2: Launch the Diskpart Utility
In the Command Prompt window, type the following command and press Enter:
diskpartStep 3: Identify and Select the Target Disk
List all drives currently connected to the computer by typing:
list diskIdentify the disk number corresponding to the drive you want to erase (e.g., Disk 0, Disk 1).
Select the target disk by running:
select disk #(Replace
#with your specific disk number, for example:select disk 1).
Step 4: Choose a Cleaning Method
Option A: Standard Clean (Fast)
This command deletes all partition tables, formatting, and volume signatures, making the drive appear unallocated. The underlying data remains recoverable using recovery tools.
cleanOption B: Full Wipe / Clean All (Secure)
This command writes zeros to every sector of the drive. It completely overwrites all data, making recovery impossible, and takes longer depending on the drive size.
clean allStep 5: Initialize and Format the Cleaned Drive (Optional)
To make the drive usable again immediately, run the following commands sequentially:
Create a primary partition:
create partition primaryFormat the partition using NTFS (or
fs=exfatfor cross-platform use):format fs=ntfs quickAssign a drive letter:
assign
Step 6: Exit Diskpart
Type the following command and press Enter to close the Diskpart tool:
exitClose the Command Prompt window. The drive is now clean, formatted, and ready for use.