sodcalculator

10 Tech How-To

Remove Write Protection Error from USB Drives

Guide 10-8940 · Updated · Step by step

If your USB drive refuses to copy, delete, or format files and shows a “write protection� or “disk is write-protected� error, the fix usually involves clearing a read-only attribute, checking a physical lock switch, or editing the Windows registry. Below are the proven methods to remove write protection and restore full access to your drive.

What Causes Write Protection on a USB Drive?

Write protection is a state that prevents any data from being written to, modified, or erased from a storage device. It can be triggered by several things:

  • Physical lock switch: Many SD cards and some USB drives have a tiny sliding switch on the side. If it’s in the “lockâ€� position, the drive becomes read-only.
  • Registry settings: Windows has a registry key called WriteProtect that can globally block writes to all removable drives.
  • File system corruption: A corrupted file system can make the drive appear write-protected even though it isn’t.
  • Third-party encryption or security software: Some tools lock drives to protect data, and the lock can persist after the software is removed.
  • Failing hardware: A dying USB controller can sometimes switch the drive to a read-only mode to prevent further damage.

Check the Physical Lock Switch First

Before touching any software, inspect the USB drive or SD card for a small switch. If you find one, slide it to the “unlock� position and reinsert the drive. This is the simplest fix and solves a surprising number of cases. If there is no switch, move to the software methods below.

Remove Write Protection Using Diskpart (Command Prompt)

Diskpart is a built-in Windows utility that can clear the read-only attribute on a drive. Follow these steps carefully:

  1. Insert the USB drive into your computer.
  2. Open Command Prompt as administrator (search for “cmd�, right-click, and choose “Run as administrator�).
  3. Type diskpart and press Enter.
  4. Type list disk and press Enter. Note the disk number of your USB drive (e.g., Disk 1).
  5. Type select disk X (replace X with your disk number) and press Enter.
  6. Type attributes disk clear readonly and press Enter.
  7. Type exit and press Enter.

If the command succeeds, the write protection should be removed. Try copying a file to the drive to confirm. If you get an error like “Diskpart failed to clear disk attributes,� the drive may be physically locked or failing.

Clear Write Protection via the Windows Registry

If Diskpart doesn’t work, a registry entry may be forcing write protection on all removable drives. This method edits the registry, so back up your registry first (File > Export in regedit).

  1. Press Win + R, type regedit, and press Enter.
  2. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies
  3. If the StorageDevicePolicies key doesn’t exist, right-click on Control, choose New > Key, and name it StorageDevicePolicies.
  4. Inside that key, look for a DWORD value named WriteProtect. If it exists, double-click it and set its value to 0. If it doesn’t exist, create it (New > DWORD (32-bit) Value) and set it to 0.
  5. Close regedit and restart your computer.

After restarting, try writing to the USB drive again. Setting WriteProtect to 0 disables the global write protection.

Format the Drive to Fix File System Corruption

Sometimes the drive’s file system is corrupted, which can cause write protection errors. Formatting will erase all data, so only do this if you’ve backed up what you need (or the data is already lost).

  1. Open File Explorer, right-click the USB drive, and select “Format�.
  2. Choose a file system: FAT32 for maximum compatibility (but files over 4GB are not supported), NTFS for Windows-only use with large file support, or exFAT for cross-platform use with large files.
  3. Uncheck “Quick Format� to do a full format, which scans for bad sectors.
  4. Click Start and wait for it to complete.

If formatting fails with a write protection error, use Diskpart to clean the drive entirely:

  1. Open Command Prompt as administrator.
  2. Type diskpart, then list disk, then select disk X (your USB drive).
  3. Type clean to remove all partitions and formatting.
  4. Type create partition primary, then format fs=ntfs quick (or exFAT/FAT32), then assign to give it a drive letter.

What to Do When Nothing Works: Hardware Failure

If you’ve tried all the above and the drive still shows write protection, the drive may be failing. Many USB controllers switch to read-only mode when they detect NAND flash degradation to prevent data loss. In this case, the drive is likely at the end of its life. Copy any data you can off it immediately, then replace it. There is no reliable software fix for hardware-level write protection.

Frequently Asked Questions

Why does my USB drive say “The disk is write-protected� even though there is no lock switch?

Most likely a registry setting or a corrupted file system is causing the issue. Follow the registry method above, and if that doesn’t work, try Diskpart to clear the read-only attribute. If both fail, the drive’s controller may have failed.

Can I remove write protection on a Mac?

Yes. On macOS, you can use the Disk Utility to erase the drive (which removes most write protection). If the drive is physically locked, you must unlock it first. For software-based write protection, you can use the diskutil command in Terminal to unmount and remount the drive, but if the drive is failing, no software will help.

Will formatting a write-protected USB drive damage it?

Formatting won’t damage the drive, but it will erase all data. If the drive is failing, formatting may fail or take a very long time. Always try to copy important data off first.

Is it safe to use a USB drive that was write-protected after I remove the protection?

Generally yes, but if the write protection was caused by a hardware fault, the drive may become unstable. Back up your data regularly and consider replacing the drive if you notice other errors.

How do I remove write protection from an SD card?

SD cards almost always have a physical lock switch. Check that first. If it’s not the switch, you can use the same Diskpart or registry methods on a PC, or Disk Utility on a Mac. Some SD cards also have a “lock� feature in the camera that can be disabled in the camera’s menu.

Does write protection prevent viruses from infecting the drive?

Yes, write protection prevents any data from being written, including malware. That’s why some users intentionally enable it on drives they use for booting or data recovery. However, it also prevents you from cleaning or updating the drive.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →