Steps to Run DiskPart Clean All Command to Erase SSD Drive

In this post, you will learn how to use Diskpart “clean all” command to wipe SSD, as well as a better way to secure clean SSD drive in Windows 11/10/8/7.


By Emily / Updated on October 12, 2023

Share this: instagram reddit

When need to clean data on SSD drive?

Solid State Drive has become a more popular choice for computer users to store important files than traditional hard disk drive thanks to its amazing reading and writing speed. However, sometimes we also need to clean data on the SSD drive for some reason including protecting sensitive information on the drive from prying eyes, releasing disk space for new data, optimize SSD performance, or giving it a start fresh.

Clean SSD

What does ”clean all” do in Diskpart?

When it comes to cleaning SSD successfully, you can use DiskPart command "clean" or "clean all". Both commands can erase or wipe a disk leaving it unallocated and not initialized. But they have a slight difference.

"clean" command will delete all partitions on the SSD drive. But it only marks the data as deleted, not zero the disk. This data can be recovered using special data recovery software.

“clean all” command will erase the drive's contents securely. It will write over every sector on the disk and zero out completely to delete data on the disk. And the deleted data cannot be recovered via usual tools.

Steps to run “clean all” command on SSD

From the "diskpart clean vs. clean all" above, we know that Diskpart clean all command is more secure to delete everything on the solid-state drive and decrease data recovery possibility. So many users would like to use this command when it is necessary to clean the SSD drive. Below is how to do it step by step.

Before proceeding:
▸Go to Disk Management to check the disk number of the SSD drive you want to erase and remember it to ensure you erase the right disk.
▸If you want to keep something important on the SSD drive, you can back up them to another hard drive via free backup software.

1. Open the elevated command prompt: click "start" button, input "cmd" in the search box and press Enter, right click the program and choose "Run as administrator".

2. In the pop-out command prompt window, type "diskpart" and press Enter to launch the utility.

3. Type "list disk" and press Enter: get a list of disk numbers to select from.

4. Type "select disk #" and press Enter: substitute # for the disk number listed that you want to run "clean all" command on. Here we select disk 2.

5. Type "clean all" and press Enter.

Diskpart Clean All SSD

When the word “DiskPart succeeded in cleaning the disk” appears, type "exit" and press Enter to close the elevated command prompt window.

Frequently Asked Questions about clean all command on SSD
Q: How long does Diskpart clean all on SSD take?
A: "Clean all" command will take around an hour per 320GB to finish running since it performs a secure erase.
Q: Does diskpart clean remove MBR?
A: Use the diskpart clean command on a disk only removes all partitions from the disk with focus. It won’t clean MBR.
Q: Is it safe to use “clean all” command on SSD drive?
A: It is not recommended to run “clean all” on a solid-state drive too often since writing zero to every sector might reduce its SSD lifespan to some degrees.
Q: What if the SSD is offline in the disk list?
A: If you find the status of the target SSD drive is offline in the disk list, you need to execute "disk online" command between "select disk #" and "clean all" commands.

A GUI tool to secure clean SSD without damage

If you are not good at wiping SSD from command prompt in Windows, or you think it takes a very long time to securely erase an SSD drive, you can switch to AOMEI Partition Assistant Professional. This GUI tool is quite intuitive, easy to use for both computer experts and newbies.

Compared with Diskpart clean all command, its “SSD Secure Erase” feature can clean SSD data without damaging its lifespan and performance. This feature only works on Windows 7 computer by far, so you need to connect the target SSD to a Windows 7 PC before taking the following steps.

1. Install and run AOMEI Partition Assistant Professional. (The Demo Version is available for a free trial).

Free Download Win 11/10/8.1/8/7/XP
Secure Download

2. In its main interface, click “Wipe” in the top toolbar, and choose “SSD Secure Erase”.

SSD Secure Erase Samsung

3. Choose the SSD drive you need to erase from the given disk list and click "Next".

Choose SSD Samsung

4. Here you can view and check the basic information of the selected SSD drive.

SSD Identification Information Samsung

Warning: you might find the SSD drive is in a frozen state, if you click "Next", you will receive an error message shown below. To continue with secure erase, you can refer to the given tutorial to perform hot swap for the SSD.

Frozen State OK Samsung

5. After a successful hot swap, then click "Next" to start the SSD Secure Erase.

Waiting Erasing Samsung

Apart from cleaning SSD drive in a simpler and safer way, AOMEI Partition Assistant Professional also offers many other amazing functions to manage disk partition in Windows 10/8/7 and Windows XP/Vista, such as:

Align SSD partition to boost its data writing and reading speed;

▸Migrate OS to SSD or HDD with successful boot from the destination disk;

Recover deleted data or partition on SSD drive, HDD, SD card, USB flash drive;

▸Wipe a hard disk drive (HDD), or other USB drives completely and securely;

▸Convert boot disk from MBR to GPT, or GPT to MBR without deleting partitions/losing data.

Final words

On this page, we have discussed how to perform Diskpart clean all on SSD, as well as shared a better way to securely clean SSD drive. Now you can choose one based on your needs. To help users to manage disk partition more flexibly and conveniently, AOMEI Partition Assistant Server is developed for Windows Server 2019/2016/2012/2008/2003 users. If you want to install such a versatile program on unlimited Windows PC and Server, the Unlimited Edition can satisfy you.

Emily · Staff Editor
Emily is an English editor of AOMEI Technology; she has a great passion for providing easy solutions for people to tackle with all disk or partition management problems. In addition to writing articles about disk/partition management, she also edits great tutorials on how to back up and restore disk for data security. In her spare time, she loves to learn computer skill to improve herself or stay with her family to enjoy a good day.