How to Fix the Error ‘DiskPart failed to clear disk attributes’

disk-part-failed-to-clear-disk-attributes

DiskPart is a tool that allows managing disks and partitions through the command line. In essence, you can clean and format drives, assign drive letters, create or delete partitions etc. It is also possible to change the read-only attribute of a storage device using this tool. (One instance where you may need to do this is when you are unable to transfer files to the storage device).

But while changing the read-only attribute using DiskPart through command prompt, many users have reported the following error.

‘DiskPart failed to clear disk attributes’.

If you are encountering this error, then read this blog to find some solutions that will help you resolve it. The reasons for this error as well as corresponding solutions are covered here.

Solution 1: Check the physical switch on the USB

Certain USB devices have a physical switch that lets you turn ON or OFF the write protection. If the switch is ON, it means that the write protection attribute is turned ON and you won’t be able to write anything on the USB.

Ideally, if this switch is turned ON, you may get the error while trying to change the read-only attribute setting through the command prompt.

In order to overcome this error, turn OFF this switch and re-insert the storage device to your system. Then try transferring data to the device. If you are unable to, then change the read-only attribute using the Diskpart command and try again.

Solution 2: RUN CHKDSK

The error may also be caused due to corruption in the file system or bad sectors on the storage device. If these errors are present in the storage device, Windows will not be able to change read-only attributes and hence produce errors. In order to overcome this problem, you can try running CHKDSK on the device.

  1. Type ‘cmd’ in the taskbar search
  2. Select Command Prompt and choose Run as Administrator
  3. In the Command prompt, type the following command

CHKDSK X: /F (where X: is the drive letter of the storage device)

Solution 3: Format the USB drive

If your USB drive has turned RAW, then you may receive the error ‘Diskpart failed to clear disk attributes’. In that case, you will need to recover data from RAW drive and format it.

To format the USB drive,

  1. Type ‘cmd’ in the taskbar search and open Command Prompt and Run as Administrator
  2. When the command prompt opens, type the following commands:
  • ‘list volume’ (Note down the volume # of the USB drive)
  • ’select volume #’ (where # is the number associated with the USB drive, which you noted down in the previous step)
  • ‘format fs=fat32’ (You can also change the file system to any of your choices)
  • ‘exit ‘

Remove the storage device and connect it back again. Now, check if you can transfer files to it. If not, change the attributes through DiskPart and try again.

If none of the above methods work, it could probably be that the USB device is faulty. In that case, you may need to further examine the device or replace it in worse cases.

Recover data from corrupt or inaccessible USB devices

If the USB flash drive or any storage device (like an external or internal hard drive) is corrupt or turned inaccessible, you can recover data from them using a tool called Hi5 Software. This tool is specialized in recovering data from RAW hard drives or inaccessible hard drives. After you’ve recovered data, you can format the drive to resolve corruption issues. Once formatted, the drive is as good as new and ready to be used.

Hi5 data recovery software can not only recover data from corrupt drives, but it can also be used in numerous other scenarios. For instance, it can be used to recover data after diskpart clean, after a factory reset or even after formatting a drive.

Leave a Reply

Your email address will not be published. Required fields are marked *