Fix Diskpart Clean not Working Easily (5 Ways)

When diskpart clean not working, you can fix it with 5 easy ways. Please read on to know more details.

Clytze

By Clytze Updated on October 27, 2022

Share this: instagram reddit

User Case

“Hi, I have a hard drive with multiple partitions on it. I want to run the clean command on it using diskpart. I have selected it but when I run the clean command on it, it just tells me: "diskpart has encountered an error access is denied". Any help would be appreciated! Thanks!”

This error is caused due to a number of factors. It is possible the drive's Write-Protection is enabled or the Command Prompt terminal does not have administrator-level permissions. The article provides you with five solutions.

Common Error Types for Diskpart Clean not Working

You can use Diskpart Clean to erase a disk. It will remove any and all partition or volume formatting from the disk. However, as mentioned in the user case, you may also encounter some error messages when we use this tool. We have summarized the following five common errors for you.

  • Access is denied
  • I/O device error
  • The device is write protected
  • Data error (cyclic redundancy check)
  • Device not ready error

How to Fix Diskpart Clean not Working

If you encounter any of the above errors, you can use the following methods to solve them. Next, I will introduce you the five solutions to fix diskpart clean not working in turn.

Method 1. Reconnect the Target Device to the Computer

When your hard drive or external USB or SD card is not correctly connected to your computer, diskpart will not be able to perform any formatting or cleanup command line. It means you meet the “Device not ready error”. Therefore, you can try reconnecting the device.

First, you need to Unplug the USB, SD card from your computer. Next, you should Reconnect the target device to the computer again. Finally, please Log in to your computer as an administrator.

Method 2. Check If the Drive Is Occupied or Locked

If the target device is connected correctly, then you can check if the drive is occupied or locked. If so, it will cause diskpart clean not working. And you will see this kind of error message “Data error (cyclic redundancy check)”

Step 1. Keep the target device connected to the computer and open File Explorer.

Step 2. Turn on the target device to check if all data is accessible.

Step 3. If the target device is accessible, then you can clean the drive normally. If the system warns you the device is being occupied by a running program or file, please close it and then confirm again whether the target device is accessible.

Method 3. Unlock the Drive and Remove Write Protection

This method is to fix the error “The device is write protected”.

When a storage device is locked, encrypted, or write-protected, you may not access or change the drive. Thus, you need to unlock, decrypt and remove the write protection from the target disk at first. Then the diskpart clean will work normally.

Step 1. Run Command Prompt as administrator, type diskpart, and press Enter. To open Command prompt, press Win + R, type cmd in the Run box, and click OK.

Step 2. Type list disk and press Enter. Then all disks on your computer will be listed.

Step 3. Type select disk X and press Enter. X means the actual disk number, for example, you want to remove read-only for volumes on disk 1, then you should enter select disk 1.

Step 4. Input attribute disk and press Enter. Then you can see whether the disk is read-only or not.

Attribute Disk

Step 5. Type command attribute disk clear read-only and press Enter. The Current Read-Only State and Read-only will be set to No. Then you can try diskpart to check whether the error is fixed.

Method 4. Use Windows Installation Disc to Wipe Disk

When you encounter this error “ Access is denied”, it may be the wiped disk contains system files. So, you need to boot your computer with the installation disk then erase it in PE environment. You can follow the steps below.

Step 1. Insert the Windows installation disc, then boot from it.

Step 2. Click Repair your computer> Troubleshoot > Advanced Options > Command Prompt.

Step 3. Input the diskpart commands to clean the hard disk. Each time you type a command line, remember to press Enter to execute it.

  • diskpart
  • list disk
  • select disk [disknumber]
  • clean all

Disk Clean

Method 5. Use Alternative Tool to Wipe Disk

Besides the above solutions, you can use alternative tool to solve this problem, for example, AOMEI Backupper Professional. It is a professional disk erasing software that helps you to erase your disk safely.

You can choose to erase the whole disk or partition(s). You can use the wiping method Fill sectors with Zero to erase your disk. It will delete the contents of the disk and then replace them with zero.

Here is a specific tutorial. Please note that disk wipes will erase all data, so please backup your important files before wiping them.

Step 1. Download AOMEI Backupper Professional, install, and open it. Then click Tools > Disk Wipe.

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

Disk Wipe

Step 2. Select Wipe disk and click Next.

Choose Wipe Disk

Step 3. Select the disk you want to wipe and click Next.

Wipe Data Select Disk

Step 4. Click the first option Fill sectors with Zero and then click the Start.

Wipe Method

Notes: If you want to erase your disk more thoroughly, then you may also use the following three methods.

  • Fill sectors with random data: This feature overwrites the data on the disk by random numbers, which is more secure than the first method. The erased data is more difficult to be recovered.
  • DoD 52220.22-M: This feature allows you to adjust the wiping times, ranging from three to seven.
  • Gutmann: It is the most thorough way among them, choosing this way can help you erase the disk 32 times.

Summary

I believe you have learned how to deal with diskpart clean not working by reading the passage. Each of the methods mentioned above can help you solve it easily. For me, I would prefer to use a professional disk wiping software, such as AOMEI Backupper. 

The Fill sectors with Zero feature can help you erase disk safely. If you prefer a more professional wiping method, you can choose the latter three methods. By the way, DoD 52220.22-M and Gutmann can help you perform multiple wiping times and allow you to adjust the erasing times by yourself.

Clytze
Clytze · Editor
Clytze, an editor at AOMEI Technology, is passionate about safeguarding your digital world. She dedicates her expertise to empower users like you in data security and recovery. She firmly believes that everyone should have the tools and knowledge to protect their digital assets through computer backup, seamless disk cloning, and efficient file synchronization. Clytze is your trusted guide on the journey to data safety.