Diskpart is a Windows built-in tool for users to clean up disk, format drive, or convert disk for free. However, sometimes Diskpart may not work due to some errors. If the Diskpart command fails to execute your command, don't worry.
If you are getting SD card 'read-only' error message and you have also checked the card is not write-protected, then try to fix the error by using diskpart utility in CMD command. Follow the below steps to use diskpart fix method: Connect SD card to Windows PC. Sometimes, when your hard drive, USB pen drive or SD card is read-only or write-protected, you'll need to run Diskpart with attributes disk clear readonly command to remove the read-only state from your device. However, some people complaint that Diskpart failed to clear disk attributes for unknown reasons.
You can either follow fixes on this page to make Diskpart work normally again or choose a Diskpart alternative tool to resolve this issue on your own:
- How to Fix Diskpart Clean Not Working Error
- Fix 1. Reconnect the Target Device
- Fix 2. Check if Drive Is Being Occupied or Locked
- Fix 3. Unlock Drive, Remove Write Protection
- Fix 4. Clean Disk Using Free Diskpart Alternative Tool [Easiest]
- Fix 5. Clean Disk Using Diskpart Command
Later, when you see “Diskpart succeeded in cleaning the disk”, which means clean operation is done. However, using Diskpart to erase USB drive/SD card takes a certain risk, especially for people who are not good at computers. It is inconvenient to distinguish which disk is exactly the USB flash drive/SD card. Solution 2: Clean the SD card via Diskpart. Just like Disk Management, Diskpart is also a native utility application in Windows that you can access from the command prompt. In case Disk Management or any other GUI solution is not working on Windows, then this would be a perfect solution to secure-erase an SD card. Step 1: Load the Diskpart module.
Among these fixes, EaseUS Partition Master can assist you in formatting, erasing your USB, SD Card, or drive with ease.
Case - DiskPart Clean Not Working Error
'Hi there, do you know how to clean up a whole disk or USB drive when the diskpart clean command is not working in Windows 10? I was planning to use the Diskpart to erase my external hard drive so to wipe out all data. But it won't work.
Instead, it prompts an error message, warning that 'DiskPart has encountered an error: Access is denied...'. How can I fix this error, any DiskPart alternative method that can help me fix this issue? '
Are you having the same error on your computer? You want to use Diskpart to format or clean a hard drive, USB, or SD card, but the command window warns that Diskpart has encountered an error.
So why is Diskpart not working? Mostly, the Diskpart not working error is caused by the following reasons:
- 1. Drive is occupied or being used by other programs.
- 2. USB or SD card is locked or write-protected.
- 3. Hard disk is encrypted by a third-party encryption tool.
With one of the listed problems on your device, Diskpart won't be able to execute any formatting or disk erasing command. As for the specific fixes, follow the next part, you can find all the detailed steps shown below.
How to Fix Diskpart Clean Not Working Error
Applies to: Fix Diskpart clean not working, cannot clean disk in Diskpart error in Windows 10/8.1/8/7, etc.
When Diskpart stops working or won't work for formatting or cleaning disk, follow the 5 fixes that you can apply to fix not working Diskpart on your computer immediately. Then, you can complete cleaning up disk or formatting drive, USB or SD card, etc. on your own.
Fix 1. Reconnect the Target Device to PC
Sometimes, when your hard drive or external USB, SD card is not correctly connected to the computer, Diskpart won't be able to execute any formatting or cleaning command lines. So your best choice is to reconnect the device:
Step 1. Unplug your USB, SD card from PC.
If it's a hard drive, reinstall it to your computer via a SATA cable and a power cable.
Step 2. Reconnect the target device to your PC again.
Step 3. Log in your computer as an Administrator.
Now, you can move to Fix 2 to check if the drive is currently locked or encrypted.
Fix 2. Check if Drive Is Being Occupied or Locked
Step 1. Keep the target device connect to your PC and open File Explorer.
Step 2.Try to open the device to see if you can access all data.
Step 3.Once the target device is accessible, follow Fix 4 or Fix 5 to clean the drive.
If the system warns that your device is being occupied by a running program or file, close the running program or opening file. Then move to Fix 4 or Fix 5 to execute the disk cleaning operation.
If you receive a notification, telling that your disk is write-protected, unlock or remove write protection from the device first with tutorials in Fix 3.
Fix 3. Unlock Drive, Remove Write Protection
Note that when a storage device is locked, encrypted, or write-protected, you won't be able to access nor make any changes to the drive. So the first thing to fix Diskpart not working error is to unlock, decrypt, and remove write-protection from your target disks.
You have four options:
#1. Unlock External USB/SD Card
Step 1. Connect the external USB or SD card to PC correctly.
Step 2. Change the Switch on USB or SD card to the Off-side.
Unlock SD card:
Unlock USB:
After this, you can run Diskpart clean command to clear the USB or SD card now. For an easier way, turn to EaseUS Partition Master as shown in Fix 4 for help.
#2. Remove Read-only State from Device
Device display as Read-only is a common issue that stops Diskpart from cleaning or formatting a storage device. If your disk shows as Read-only in Disk Management or says it's read-only, take the steps below to clear this state, making your drive accessible again:
Step 1. Keep the device connected to your PC correctly.
Step 2. Press Windows + R, type cmd and hit Enter to open Command Prompt.
Step 3. Type the command lines here and hit Enter each time to clear read-only state from your device:
- diskpart
- list disk
- select disk #
- attributes disk clear readonly
Replace # with the disk number of your target device.
Step 4. Type exit to close the program once the process completes.
#3. Remove Write Protection by Editing Registry Key
When a storage device is write-protected, you can follow the steps here to remove write protection by editing the registry key:
Step 1. Connect the write-protected device to PC.
Step 2. Type regedit in the Run dialog and click 'OK' to open Registry.
Step 3. Navigate to: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlStorageDevicePolicies.
Step 4. Double click 'WriteProtect' key and change the value to '0', click 'OK' to confirm.
After this, exit Registry and restart your PC. There, you should be able to access the drive and clean it via Diskpart clean command now.
Remove Writ Protection Tool
If you are not professional in computing management and not familiar with command lines, don't worry. EaseUS R&D team has promoted a fresh kit for helping you resolve the write-protection issue on your hard drive, external hard drive, USB or SD card, etc., devices.
EaseUS Tools M is a practical computer fixing tool that is safe and light-weighted. It's a perfect alternative to the command line.
Use this one-click tool to solve the write-protection issues on your own:
Step 1: DOWNLOAD and install EaseUS Tools M for free.
Step 2: Run EaseUS Tools M on your PC, choose the 'Write Protection' mode.
Step 3: Select the device which is now 'Write-Protected' and click 'Disable' to remove the protection.
#4. Decrypt Device using Third-party Tool
Note that if your hard drive, USB, or SD card is encrypted by a third-party software or encryption program, you will need to use the encryption tool to decrypt the drive.
Fix 4. Clean Disk/USB/SD Card Using Free Diskpart Alternative Tool
Best for: Windows beginners, all levels of Windows users;
Note that if you prefer an all-in-one disk cleaning tool, Diskpart is not the best shot. It's even too complicated for Windows beginners.
Here, we'd like to recommend you to try Diskpart alternative freeware - EaseUS Partition Master Free. It works as equivalently as diskpart in formatting devices, cleaning up and erasing data or changing file systems on your USB, SD card, or hard drive.
Follow to clean up your disk, USB, or SD card now:
Step 1. Launch EaseUS Partition Master, right-click the partition you want to erase data from, and choose 'Wipe Data'.
Step 2. In the new window, set the time for which you want to wipe your partition, then click 'OK'.
Step 3. Click the 'Execute Operation' button in the top-right corner, check the changes, then click 'Apply' to wipe the data on your partition.
After this, your disk is blank and you can apply the Create partition feature in this tool to create new partitions to save your data.
Besides, it even supports you to resize partition, create a new partition, delete or even command partitions for free on Windows 10/8/7/Vista/XP.
Fix 5. Run Diskpart Clean Command to Clean Drive/USB/SD Card
Finally, you should have fixed all the errors which stop diskpart from working in the system disk, external storage devices. And then, you can run a disk clean command in Diskpart to make it 100% working again:
Clean Disk via Diskpart Clean Command:
Step 1. Connect your device to PC.
Step 2. Press Windows + R keys, type cmd and hit Enter to open Command Prompt.
Step 3. Type the clean command lines here to wipe your disk and hit Enter each time:
- diskpart
- list disk
- select disk #
- clean or clean all
Replace # with your drive number.
'Clean' means to delete everything on your drive but files are recoverable.
'Clean all' means to erase your drive, data, both partitions and data will be unrecoverable.
Step4. Type exit to close the Window.
Conclusion
On this page, we explained the causes of Diskpart clean not working error, and provide the complete resolution to help you fix this issue. If you are with this error, reconnect your drive, and remove the write protection first.
Then, apply the easiest Diskpart clean alternative tool - EaseUS Partition Master Free to easily wipe the hard drive, clean everything on your drive in only a few simple clicks.
If you have more questions related to Diskpart clean, check the questions and answers listed here. Hope we can solve your doubts.
People Also Ask About Diskpart Clean
1. Does Diskpart clean erase data?
Note that Diskpart clean command is set to delete all partitions and data on the target device. Accordingly, the data that gets cleaned is recoverable. So the answer is no.
Diskpart clean command will not erase data. But the Diskpart clean all command will do.
2. How long does Diskpart clean take?
According to most users and EaseUS partition master expert, Diskpart clean is a very shot process. It only takes 1-2 minutes to delete everything from the drive.
But the clean all command in Diskpart will last longer, about 4-5 minutes or so. Because it will delete all the partitions on your target device and erase all saved files.
3. How do I format disk via Diskpart command?
If you want to format a hard drive, USB, or SD card using Diskpart, here is a simple guide that you can follow:
- 1. Connect target disk to PC.
- 2. Press Windows + R, type diskpart, and hit Enter.
- 3. Type list disk and hit Enter.
- 4. Type select disk # and hit Enter.
- 5. Type format fs=ntfs quick or format fs=fat32 quick and hit Enter.
- 6. Type exit and hit Enter.
Read More: Format USB Flash Drive using CMD.
Now that you can apply diskpart to format a disk, clean up data in hard drive partition or change the file system of USB/SD card, etc. storage devices in your PC again.
Summary :
After investigating, I found that many reasons can cause DiskPart to encounter an error. When this occurs, your data might get lost from the certain disk. Therefore, this post is to offer you an effective way to recover data when this issue troubles you, as well as possible causes and solutions for such an error.
Quick Navigation :
DiskPart Has Encountered an Error the Request Could Not Be Performed
Apart from the Windows built-in Disk Management, DiskPart is also a useful tool you can rely on to manage disks & partitions reasonably and fix errors in every Windows system.
- The DiskPart has more functions and magic than most third-party partitioning wizards and its functions are even more powerful.
- But it has an obvious disadvantage – it runs under the command prompt, which tends to cause many people to make mistakes because they are not familiar with DOS operations.
DiskPart Has Encountered an Error
You’ll receive the DiskPart has encountered an error the request could not be performed because of an i/o device error, the parameter is incorrect, the system cannot find the file specified, CRC data error, etc. The error prevents you from accessing a disk, but it can be fixed easily by various methods.
When there’s something wrong with the disk, DiskPart will strike. For instance, DiskPart has encountered an error is a frequently seen alert message. The results of the survey show that this error can be caused by a lot of reasons.
- Parameter is incorrect.
- Access is denied
- I/O device error
- Media is write-protected
- Data error (cyclic redundancy check)
- The system cannot find the file specified
- The device is not ready
- …
Here, in the following content of this article, I will show you how to recover useful data from the problematic disk with MiniTool Power Data Recovery – a professional data recovery program favored by plenty of computer users. Then, I will introduce and analyze the main causes for said hard disk error and give corresponding solutions.
Recover from DiskPart Has Encountered an Error
Diskpart Clean Sd Card Free
I will summarize 6 cases related to DiskPart has encountered an error problem in the next section. You can find the case that is similar to your situation and try to find solutions correspondingly. But in this section, I will first show you how to recover data from the defective disk.
How to Recover Data from Disk with Error
How to recover data from I/O device error or other types of errors?
The first step is definitely to download MiniTool Power Data Recovery.
Of course, you can download the trial edition to experience in advance. But keep in mind that the trial edition can only scan the disk and preview files; it cannot save the scanned data for you.
The second step is to install and run the software, and then select the most suitable option from the left side of the main interface shown below (take the trial edition as an example).
The third step is to scan the drive on which the DiskPart has encountered an error shows up.
- When running into the problem: DiskPart has encountered an error, you’ll receive an error message. It suggests that your disk is inaccessible, but it does exist. So at this time, you should select the Hard Disk Drive from the left pane, which is used for deep scanning and recovering data from damaged, RAW or formatted drive.
- Please select the target drive from the right pane and click on the Scan button in the lower right corner to search for the lost files.
- In the lower right corner of above interface, there is also a Settings button next to the Scan button. It actually allows you to configure the scanning range to only specified file systems or file types. This will help you locate the needed files easily and quickly from the scan results in the next step.
The fourth and final step is to pick out the needed files found by the data recovery software and click on the Save button to specify a storage path for them.
Please add check marks to the square box in front of the File Name column (you can choose to check all files in a found drive or check only some of the files included in it).
Please note:
If there are too many files displayed in the scanning results, it could be difficult finding certain files. However, you can make things easier by using the Find function and Filter function that help you locate the needed files accurately by file name, file extension, file size, file creation date and modification date.
If you need to recover data lost by DiskPart clean, but have no experience, the software recommended in this page will be your great assistant.
Till now, I have shown you all the steps to recover data from an inaccessible drive; please follow the steps above carefully when DiskPart encounters an error.
Causes & Solutions – DiskPart Has Encountered an Error
The following 6 symptoms are the most common cases of DiskPart has encountered an error. Each of them has different causes and solutions, so you should assess the situation that resonates with yours the most and take measures correspondingly to fix the error.
DiskPart Has Encountered an Error: the Parameter Is Incorrect
The error – “DiskPart has encountered an error: The parameter is incorrect.” – occurs sometimes on users’ computer. Here, 2 of the most popular causes of this problem are listed:
- The file system of the target partition is corrupted or damaged.
- The full volume encryption driver is changed in Windows.
Case:
I have a hard drive that after attempting to dual boot ended up useless. I finally got some files off it and was ready to wipe it and start over. Windows 10 wouldn't install so I deleted everything, formatted entire drive, created new primary partition-still nothing. Using command prompts I cleaned the drive, created a new primary partition and tried to format it. After saying it was 100% completed, it said, “DiskPart has encountered an error: The parameter is incorrect.” I've tried clean all command for a more thorough job and gotten the same error. Hard drive test says it's good. Does anyone have any ideas? Thanks in advance for any help.– said by Superman1148 on Computing.net Forum
What if you want to recover data from the volume does not contain a recognized file system error? Please read this:
When you meet 'the volume does not contain a recognized file system' problem, you should resort to MiniTool Power Data Recovery.
How to fix the error? (The following steps are completed in Windows 10)
Solution 1: enable error-checking function.
- Open Windows Explorer to locate the target drive (how to fix when Windows Explorer needs to be restarted).
- Right click on the drive.
- Choose Properties from the context menu.
- Shift to the Tools tab.
- Find Error checking and click on the Check button.
- Choose to scan the drive.
- The disk check process will be started and finished automatically.
Solution 2: run the command chkdsk /f /r.
- Type cmd into the search box on taskbar (how to fix when Windows 10 taskbar is not working).
- Right click on Command Prompt from the search result.
- Choose Run as administrator.
- Choose Yes in the User Account Control window.
- Type chkdsk /f /r *: (“*” stands for the letter of the target drive).
- Press Enter on the keyboard.
- Wait for the completion of the check process.
You can also use other methods to open cmd.exe.
DiskPart Has Encountered an Error: Access Is Denied
According to the investigation, the error – “DiskPart has encountered an error: Access is denied” – tends to appear when you use the DiskPart clean or format command to clear a USB drive. Those operations will not complete due to the interruption of this error.
Case:
Hello everyone! I've been trying to format a 32GB flash drive. I'm using DiskPart to format it but still have no success. I've been trying and trying, but I always encounter the same error. “DiskPart has encountered an error: Access is denied. See the System Event Log for more information”. I tried different commands to format it, but I still arrive at the same error. I am the admin, so I don't think that's the problem. Help me please! Thank you and have a nice day!– posted by laufing on Windows Seven Forums
How to fix this issue?
Solution 1: run the Command Prompt as administrator.
- Click on the Start button.
- Scroll down to find Windows Systems folder and expand it.
- Right click on the Command Prompt option.
- Choose More from the right-click menu.
- Select Run as administrator from the submenu.
Solution 2: remove the Write-Protection.
- Type run into the search box on taskbar.
- Choose Run from the search result.
- Type regedit into the text box.
- Press Enter on the keyboard or click on the OK button in the Run window to open Registry Editor.
- Expand ComputerHKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesUSBSTOR.
- Double click on the Start option from the right panel.
- Enter 3 in the dialog box.
- Click on the OK button to confirm.
- Close the Registry Editor.
You can check the computer's event logs for more information as the error message suggests if you cannot find the exact cause of the problem.
DiskPart Has Encountered an Error: I/O Device Error
This I/O device error could be caused by a lot of reasons:
- The transfer mode or the disk interface is not appropriate.
- The target device is damaged/defective.
- The device connection is not successful (bad cable, poor connection or insufficient power supply).
- The compact disk (CD/DVD) is dirty or damaged.
Case
Hi everyone, I am trying to make a partition using command prompt. I need to partition the disks to be formatted in NTFS so I can install Windows 7 on my laptop. I've been doing this before and having no problem with my other laptops. It's my first time to encounter a problem. I'm on the step where I'll be creating a partition using cmd line. But it gives me an error message saying “DiskPart has encountered an error: The request could not be performed because of an I/O device error.” I hope someone could help me figure this out. Thanks in advance!– said by reynl07 on Tom’s Hardware Forum
How to fix this?
Solution 1: change transfer mode.
- Right click on This PC.
- Choose Manage.
- Select Device Manager from the left pane.
- Expand IDE ATA/ATAPI controllers in the right pane.
- Right click on the target channel responsible for I/O device error.
- Select Properties.
- Shift to Advanced Settings tab.
- Change the transfer mode to PIO Only.
- Click on the OK button to confirm.
Solution 2: check hardware connections.
Please change a connection cable, USB port and a power supply respectively to see whether the problem can be fixed or not.
Solution 3: clean the surface of device.
If the error occurs on a USB flash drive, external hard drive or CD/DVD, please clear the dirt and stains from the surface properly.
DiskPart Has Encountered an Error: Media Is Write-protected
If you encountered the error “DiskPart has encountered an error: the media is write protected”, you should try to change the value of the Writeprotect key using Registry Editor. Changing the value help you close the read-only mode on your media. And this will finally repair the corrupted file system of your hardware.
Please follow the steps mentioned in Solution 2: remove the Write-Protection of the DiskPart Has Encountered an Error: Access Is Denied part.
DiskPart Has Encountered an Error: Data Error (Cyclic Redundancy Check)
The data error cyclic redundancy check can be the result of many factors, such as registry corruption, unsuccessful program installation, cluttered hard disk and misconfigured files.
Case:
I’m trying to do a clean install of Win7. I’m installing it through USB I have already deleted the hard drive using Darik's Boot And Nuke. When I try to create a partition from the command prompt it gives me an error “DiskPart Error: Data Error (cyclic redundancy check)” see the system event log for more info.– posted by ed123 on Windows Seven Forums
How to fix this?
Solution 1: check disk.
Please see Parameter Is Incorrect error. Solution 1: enable error-checking function.
Solution 2: rely on chkdsk /f command.
Diskpart Clean Access Denied Sd Card
- Run Command Prompt as administrator.
- Type chkdsk /f *: into the Command Prompt.
- Press Enter on the keyboard.
- Wait for the scan to complete.
- Restart computer at the end of the process.
DiskPart Has Encountered an Error: The Device Is Not Ready
This error is mainly caused by two reasons: the disk has failed; the storage controller on your mainboard is corrupted.
How to fix?
Solution 1: run troubleshooter.
- Click on the Start button.
- Scroll down to find Windows System and expand it.
- Choose Control Panel.
- Type troubleshooting into the search control panel box or select Troubleshooting in the lower right corner when View by Small icons.
- Click on Configure a device under Hardware and Sound.
- Click on the Next button to detect problems.
- Wait for the detecting process and follow the suggestions that system offers you.
Solution 2: uninstall the USB controller.
- Right click on the Start button.
- Choose Device Manager.
- Find Universal Serial Bus controllers and expand it.
- Right click on the first USB controller.
- Choose Uninstalldevice.
- Click on the OK button in the pop-up window to confirm.
- Repeat this process to uninstall the rest USB controllers listed under Universal Serial Bus controllers.
- Restart the computer and retry DiskPart to see whether it works or not.
DiskPart Has Encountered an Error: The System Cannot Find the File Specified
Diskpart Clean Sd Card Reader
This error appears when the USB flash drive/SD card is damaged or corrupted and its file system may have turned into RAW.
With the powerful tool I recommend in this article, every one of you is able to recover data from RAW hard drive without troubles.
Verdict
It is common to run into errors while running DiskPart. Here I have summarized the 6 types of situations that could cause a DiskPart error. For each case, I also analyzed the possible causes briefly as well as gave corresponding solutions to help you recover data and fix the DiskPart has encountered an error issue. Hope these solutions can help you solve your problem.
Diskpart Cannot Clean Sd Card
If you have any questions about DiskPart encountering an error, or if you have better solutions regarding this problem, please feel free to leave a message below.