How to Fix Diskpart failed to clear disk attributes in Windows

How to Fix Diskpart failed to clear disk attributes on Windows

Wondershare Recoverit Authors

Dec 03, 2020 • Filed to: Windows Computer Solutions • Proven solutions


If you’re familiar with Diskpart and use it to manipulate your device’s drivers, you may encounter a problem saying that it failed to clear disk attributes. In this article, we will provide you with 5 solutions to fix this error.


Diskpart is a command disk partition tool built-in Windows. It’s commonly used to perform disk partitionings. Sometimes, when using this utility, you might come across the error: Diskpart failed to clear disk attributes. This usually happens if you attempt to modify storage media, such as changing a read-only device. This may due to your storage device is write-protected (usually in external hard drives and USB flash drives). It may also be due to bad sectors present in your disk, or if your new storage media is in RAW format. This happens when file systems are corrupt or there are problems with the hardware. Another common cause is when you’re not running Diskpart as an administrator. This limits your access.

Solutions to Fix Diskpart failed to clear disk attributes

For whatever reason you may be encountering this error, there are sure solutions you can use. Here are 5 solutions to Fix Diskpart that failed to clear disk attributes.

Solution 1 - Make sure physical switch on the storage device is ON

Although not very common, some external storage media like hard drives and USB flash drives have a physical switch.

Because this isn’t very common for most drives, most users overlook this. But it’s a handy feature. It serves as extra protection for the accidental altering of any data contained within the device. Once the physical switch is set to on, Diskpart can’t make any changes to the disk.

If you’ve already switched on your drive or if it doesn’t have any physical switch and you’re still unable to fix the error, proceed to the next solutions.

Solution 2 - Use Registry Editor and Change WriteProtected key

    1. Press Windows key + R on your keyboard to launch Run.
    2. Once Run is open, type in regedit in the space and press Enter to open Registry Editor.
    3. Go to the following path:


  1. This will show you a list. Find the WriteProtect registry option which is found on the left-side menu and double click it.
  2. You will be asked to assign a value. Change it to and select OK to apply the changes. Close Registry Editor.

Solution 3 - Use CHKDSK to scan for drive errors

    1. Press the Windows key + S to launch the search tool. You can also look for it in the Start menu.
    2. In the search tool, type in command prompt in the space. Look for Command Prompt and right-click on it to launch it. Choose Run as administrator.
    3. The Command Prompt window will pop up. Use the following command and press Enter (you may copy and paste this):

CHKDSK [volume [[path] filename]] [/F] [/V] [/R] [/X] [/C] [: size]]

*[/F] command fixes system errors, [/R] command fixes bad sectors

  1. You will be asked if you want to restart your device. Type in Y to reboot it.

Solution 4 - Clear attributes on RAW

    1. Press the Windows key + S to launch the search tool. You can also look for it in the Start menu.
    2. Type in diskpart in the search bar to launch it. A User Account prompt will pop up, select Yes to continue.
    3. The Command Prompt window will open. Type the following commands, pressing Enter after every command.

list volume

select volume ‘n’

format fs=fat32 quick

*NOTE: ‘n’ stands for the drive’s volume number, change it to whatever your drive’s volume number is.

  1. After typing in all the commands, unplug the removable storage device and plug it again.
  2. Check if the error persists.

Solution 5 - Check the hardware components

    1. If your computer is off, turn it on. It’s currently running, restart your device.
    2. The Basic Input Output System (BIOS) screen should appear. If it doesn’t, restart your PC again. In the BIOS screen, repeatedly press the F8 key. This will open the Advanced Options feature.

    1. You can use your keyboards to select an option using the arrows keys. Choose Safe Mode with Networking and press Enter on your keyboard.
    2. Safe Mode with Networking will now launch on your PC.
    3. Press Windows key + R  on your keyboard and hold. This will launch the Run tool.

    1. Go to this URL by copy-pasting it on the space and pressing Enter
    2. This will bring you to the website where you can download the Advanced System Repair program. Wait until the installer finishes downloading to your PC. Install the software.
    3. After the program finished installing, launch ASR to scan your system.

    1. Once the full scan is finished, select the Fix, Clean & Optimize option.

Diskpart is a powerful built-in tool created Windows so you can manage your disks and partitions on your own. But sometimes, you might encounter some errors while running this utility. With any of these solutions, you’ll surely find a fix to your Diskpart issues.

Recoverit author

Theo Lucia

chief Editor

(Click to rate this post)

Generally rated4.5(105participated)

Home > Resources > Windows Computer Solutions > How to Fix Diskpart failed to clear disk attributes in Windows