If Diskpart is unable to change the attribute of the storage device, it will give an error message. This message is very common and if there are no physical attributes damaged, the error is resolved in no time. Do note that if you are receiving this error in Diskpart, there is a high probability that other software will also prompt a similar condition.
What causes the error ‘Diskpart failed to clear disk attributes’?
The inability of Diskpart to change the attribute state of your storage device from read-only to writable can be caused by a number of different varying reasons. Some of them are listed below:
There is a physical write-protected switch on the USB device or SD card.The disk which is trying to operate on has bad sectors or is set to be hidden.Diskpart application is not running as administrator.The new USB device is with RAW format. RAW format is created when a file system is corrupted or there are hardware issues. Diskpart does not work for such kind of formats.
Before you continue with the solutions, you should make sure that you are running the Diskpart application as an administrator. If you do not have elevated access, the operating system might deny you access.
Solution 1: Turning the physical switch off
Some USB devices and SD card readers have a write-protected physical switch which disables all writable options on the storage device. This is implemented to counter accidental data deletion or overwriting. If the physical switch is toggled on, the Diskpart application will be unable to change the disk attribute to writable in any way.
Search for the physical switch at the sides of the device. Make sure it is toggled off and plug your storage device back on. First, try to normally transfer data and if that is unsuccessful, you can run the Diskpart application again as an administrator and try changing the attributes.
Solution 2: Modifying ‘WriteProtected’ key in Registry editor
Write protection is a registry entry in Windows registry editor and it acts a safeguard by limiting certain programs and applications by writing on storage devices. If the ‘WriteProtected’ flag is turned on, you will not be able to write data into your storage device successfully. To counter this, we will open the registry editor and change the key. Note: The registry editor is a powerful tool. Only change keys which you know of, otherwise, the system can go into an error state.
Solution 3: Checking drive for errors
If this error message is occurring on your hard drive, you should check it for bad sectors or logical errors. If any of these errors are present, Windows will be unsuccessful at changing the attribute type of the storage device. This method is not limited to hard drives; you can also chkdsk removable devices provided that they are recognized by the system. 1
In this case, the letter ‘F’ corresponds to the volume of the disk. You can change it according to the letter allocated to the storage device in your system.
Solution 4: Clearing attributes on RAW
If you have a USB device with RAW format, chances are that you will be unable to change the disk attribute of the storage device. As mentioned before, Diskpart doesn’t operate well in RAW formats. In order to fix the issue, we will try to convert the storage type and then try to access.
Solution 5: Check hardware components
If all the above methods failed and didn’t solve the error message under discussion, you should get your storage device checked. In many cases, this error signifies that there is a hardware problem which cannot be solved using conventional methods in Windows. If you have a warranty, go to the nearby store and ask them to inspect the storage device. Also, you can try plugging the device into other ports or change the data cable if it is a hard drive.
Fix: The Extended Attributes Are Inconsistent error in Windows 10Fix ‘Error Occurred Applying Attributes to the File’ on WindowsHow to Fix No Boot Disk Has Been Detected or the Disk Has FailedFix: DiskPart has Encountered an Error ‘Access is Denied’