Fix Diskpart failed to clear disk attributes error on Windows 10

The Diskpart Tool is a command line tool that can be used to manage partitions in a Windows system. It offers all the functions of Disk ManagementTool and a more. However, in some cases, the Diskpart utility is unable to change the attributes of the partitions and give the following message – Diskpart failed to clear disk attributes.

The probable causes of this issue are as follows:

  1. Bad sectors in the hard drive are associated with the partition.
  2. The partition might be hidden.
  3. For external drives, a physical write-protection switch might be enabled.
  4. The external drive might be in RAW format.
  5. Write-protection could be enabled for certain internal drives from the Registry as well.

Diskpart failed to clear disk attributes

You could try the following solutions to resolve the problem:

  1. Run the CHKDSK utility
  2. Check for a physical write-protection switch on external drives
  3. Change the format of the external drive from RAW to something else
  4. Remove Write protection via Registry.

1] Run the CHKDSK utility

The CHKDSK utility helps in checking for bad sectors in the hard-drive and repairing them. This should be the first step prior to concluding anything about the hardware.

2] Check for a physical write-protection switch on external drives

Some external drives have a physical write-protection switch on them. When the switch is turned ON, you wouldn’t be able to modify the contents of the drive.

A personal suggestion would be to exclude external drives while using the Diskpart utility, but if you have to use it, please turn OFF the toggle switch on the external drive.

3] Change the format of the external drive from RAW to something else

The RAW format gets created when certain files in an external drive are corrupt. It could also be caused by a hardware issue, but in that case, we cannot resolve the problem ourselves. In this situation, we would have to format the File System to either FAT or NTFS.

Press Win + R to open the Run window and type the command diskpart.

In the elevated Command prompt window which follows, type the following commands and press Enter after each one of them to execute it.

Format volume

list volume
select volume x
format fs=fat32 quick 
exit.

Where x is the drive letter of the external drive to be formatted.

Once done, you could proceed with whatever you intended to do with the Diskpart command initially.

4] Remove Write protection via Registry

The Registry Editor method could be used to resolve the issue. The procedure to do so is as follows:

Press Win + R to open the Run window. Type the command regedit and press Enter to open the Registry Editor window.

Navigate to the following path in the Registry Editor:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies

Diskpart failed to clear disk attributes

On the right-pane, double-click on WriteProtect to edit its properties.

Change the value of Value Data to 0.

Click on OK to save the settings and restart the system.

If the above-mentioned solutions don’t work, the cause could be a hardware problem. You could consult a support technician.

Download this VPN to secure all your Windows devices and browse anonymously
Posted by on , in Category Windows with Tags
Anand Khanse is the Admin of TheWindowsClub.com, a 10-year Microsoft MVP Awardee in Windows (2006-16) & a Windows Insider MVP. Please read the entire post & the comments first, create a System Restore Point before making any changes to your system & be careful about any 3rd-party offers while installing freeware.

Leave a Reply

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


9 + 5 =