How to Fix “The Disk is Write Protected” Error While Formatting USB Drive?
If you have ever tried formatting a USB drive and encountered the “The disk is write protected” error, you’re not alone. This common issue prevents users from making changes to their USB flash drive, SD card, or external hard drive.
The possible root cause often lies in the read-only attribute being set to “Yes.”
In this article, we will explain why this happens and show you how to remove write protection using the Diskpart command in Command Prompt (CMD).
The “The disk is write protected” error can be frustrating, but with the Diskpart command, you can easily remove the read-only attribute and regain full access to your USB drive.
By following these simple steps, you can regain full control over your USB device and format it without errors.
Why Does “The Disk is Write Protected” Error Occur?
Write protection on a USB drive can be caused by several factors, including:
- Physical Write Protection Switch: Some USB drives and SD cards have a small switch that enables write protection. Make sure it’s turned off.
- Corrupt File System: A damaged or corrupted file system can make the drive read-only.
- Registry or Group Policy Settings: Some system policies may block writing to external drives.
- Virus or Malware Attack: Some malicious programs can change permissions and lock your drive.
- Read-Only Attribute Set to Yes: This is one of the most common reasons and can be checked using Diskpart in CMD.
If you have verified that the physical write-protection switch is off and the problem persists, let’s proceed with removing the read-only attribute using Diskpart.
How to Fix “The Disk is Write Protected” Using Diskpart?
By following the steps in this guide, you should be able to fix the issue and format your USB without any problems. If the error persists, consider checking for registry restrictions, malware, or using third-party tools.
Diskpart is a powerful command-line tool in Windows that allows you to manage disk partitions and attributes.
Follow these step-by-step instructions to remove write protection from your USB drive:
Open Command Prompt as Administrator
- Press Windows + R, type cmd, and press Enter.
- Right-click on Command Prompt and select Run as Administrator.
Launch Diskpart
- In the command prompt, type: diskpart
- Press Enter to open the Diskpart utility. You will see a prompt with DISKPART> indicating it’s ready to accept commands.
List Available Disks
- To identify your USB drive, type: list disk
- Press Enter. This will display all connected disks on your computer.
Select Your USB Drive
- Find your USB drive by looking at the size column. If your USB drive is Disk 1, select it by typing: select disk 1 and press Enter
- You will see a confirmation message: “Disk 1 is now the selected disk.”
Check Read-Only Status
- To check if your USB drive is read-only, type: attributes disk and press Enter
- If you see “Current Read-only State: Yes”, then your USB is write-protected.
Remove Write Protection
- To remove the read-only attribute, type: attributes disk clear readonly
- Press Enter. You should see the message: “Disk attributes cleared successfully.”
Exit Diskpart
- Now, type: exit and press Enter to close the Diskpart
Additional Troubleshooting
However, if Diskpart doesn’t fix the issue, try these additional solutions, check for the registry restrictions.
- Press Windows + R, type regedit, and press Enter.
- Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies
- If you see a WriteProtect key, set its value to 0.
Nevertheless, till now if nothing works, tools like EaseUS Partition Master or Rufus can help in to format your USB drive.
Fix USB Format Error: The Disk is Write Protected Error Share on X