While using Windows DiskPart, users come across various error codes that start with “DiskPart has encountered an error”. So, in this informative blog, it is explained how to fix 6 common error messages that appear in the DiskPart tool.
- DiskPart Has Encountered an Error I/O Device Error
Cause: When there is a loose connection, faulty USB cable/ports, CD/DVD is damaged, storage drive is affected or having bad sectors, OS is using transfer mode which is incompatible to the device, etc. this error code pops up.
Try changing the USB port which you are using, if you have connected the drive using a USB cable, then swap it or switch to a USB port directly.
Change Transfer Mode:
- Right-click on This PC/My Computer. Select Manage, then Device Manager.
- Expand IDE ATA/ATAPI controllers
- Right-click on Secondary Channel (the drive channel which is causing I/O device error) and select Properties
- Switch to Advanced tab and select PIO Only in the Transfer Mode
- Hit OK and reboot the system
- DiskPart Has Encountered an Error Access Is Denied
Cause: When the user tries to Format or Clear a storage device like USB drive, pen drive, flash drive, or any using DiskPart tool, “DiskPart has encountered an error the parameter is incorrect” code emerges. Generally, when the device you are trying to clear or format is blocked/not authorized/write-protected/read-only then this error may be seen.
Try to run DiskPart command in the Command Prompt (Run as Administrator)
- Reboot the system and log in as Admin
- In the Start menu, type in cmd
- Right-click on Command Prompt and click Run as administrator
- In the next dialogue box, click Yes or provide a password.
- Execute the DiskPart command which resulted in “DiskPart has encountered an error the parameter is incorrect”
In case, “See the System Event Log for more information” message is shown along with the DiskPart access denied error then,
- Open Control Panel and select Administrative Tools.
- Open Event Viewer.
- Expand Windows Logs and click System.
- Double-click on the listed events and verify.
Note: Want to perform data recovery after DiskPart clean or format action? Then, check Remo Recover (Windows) to get 100% result!
- DiskPart Has Encountered a Data Error (Cyclic Redundancy Check)
Cause: Typically, this error arises when there are bad sectors in the storage drive on which you are running DiskPart.
- Type in cmdin the Start menu search box, right-click on the Command Prompt and choose Run as administrator option.
- Type chkdsk: D /r in the Command Prompt window (replace D with the drive letter of your storage drive having bad sectors) and press Enter
- Repeat the above step until CHKDSK says it found no problems with your storage drive.
- Finally, close the Command Prompt
- DiskPart Has Encountered an Error the Parameter Is Incorrect
Cause: This error is caused due to the modified volume encryption driver or corrupt file system of the partition, which you are trying to format, expand or shrink.
- Open My Computer or This PC.
- Right-click on the partition which is giving an error and select Properties.
- Go to Tools tab and click the Check (or Check Now) button.
- Now, Windows scans your partition and shows errors, if any detected. If no errors are found, you can proceed with manual scanning.
- So, click the Scan drive button, if you want to scan the drive manually.
After completion of the scanning process, the tool displays a confirmation message or detected errors. When done, click the Close button.
If this step fails to solve the error “DiskPart has encountered an error the parameter is incorrect”, then search for Hotfix in Microsoft Support site. If Hotfix is available for download, then get it and run.
- DiskPart Has Encountered Device Not Ready Error
Cause: If there is an issue with the storage controller on your computer main board or the device is failed completely on which you are running DiskPart command then this error message is thrown by the DiskPart.
- Open Device Manager and expand Universal Serial Bus controllers.
- Right-click on each USB controller located under Universal Serial Bus controllers and select Uninstall.
Run Windows Troubleshooter
- Open Control Panel. Search and open troubleshooting.
- In the Troubleshooting window, click Configure a device option located under Hardware and Sound. (provide the password or click Yes if asked)
- Click Next button in Troubleshoot and help prevent computer problems wizard.
- Wait till the scanning process gets completed. If errors are listed, select the one which you want to fix and hit Next.
- DiskPart Has Encountered an Error the Media Is Write Protected
Cause: If the device on which you are running DiskPart command is made read-only, its write protected switch is ON, or it is damaged due to virus attack then the error “media is write protected” pops up.
First, toggle the write-protection switch of the device to OFF position (if you cannot find out the OFF and ON position then just drag the switch to the opposite side). Then, run a virus scan on the error throwing storage device.
Remove Write Protection using DiskPart:
- Launch Command Prompt as Administrator.
- Type diskpart and hit Enter.
- Type list disk and press Enter.
- Type select disk * (replace * with the drive letter of your write-protected drive) and Enter
- Type attribute disk and click the Enter
- If Current Read-Only State and Read-only states are Yes then, type attribute disk clear read-only and press Enter.
Remove Write Protection in Registry Editor:
- In Run window, type regedit and hit OK
- Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies
- If you can’t find StorageDevicePolicies, then right-click on Control -> New -> Key. Name it as StorageDevicePolicies.
- Next, right-click on the created StorageDevicePolicies and select New -> DWORD (32-bit) Value. Name it as WriteProtect
- Now, right-click on the created WriteProtect and change its Value data to 0