How to Fix a USB Flash Drive That Shows a "Write-Protected" Error

Published on June 2, 2026

You plug in your USB flash drive, try to drag a file onto it, and suddenly you are hit with a frustrating message: "The disk is write-protected." This error locks your drive into a read-only state, meaning you can open files but you cannot save, delete, or format anything on the drive. Fortunately, you do not need to throw your drive away. Here is how to bypass this digital lock and restore your USB drive to full working order in just a few minutes.

Step 1: Check for a Physical Lock Switch

Before diving into software fixes, check the physical body of your USB flash drive (or the SD card adapter, if you are using one). Many drives feature a tiny toggle switch on the side designed to protect the data from accidental deletion. If this switch is pushed into the "Lock" position, it physically blocks your computer from writing new data. Slide the switch to the opposite position, plug it back in, and try again.

Step 2: Clear Read-Only Attributes via Command Prompt (Windows)

If there is no physical switch, the write protection is likely a software flag enabled in Windows. You can easily clear this using a built-in utility called Diskpart.

  • Press the Windows Key + R, type cmd, and press Ctrl + Shift + Enter to open the Command Prompt as an administrator.
  • Type diskpart and press Enter.
  • Type list disk and press Enter. Look at the list to find your USB drive (identify it by its size, such as 14 GB for a 16 GB drive) and note its disk number (e.g., Disk 1 or Disk 2).
  • Type select disk X (replace "X" with your actual USB disk number) and press Enter. Warning: Ensure you select the correct number so you do not alter your main system hard drive.
  • Type attributes disk clear readonly and press Enter. This command strips away the write-protection block.
  • Type exit and press Enter. Test your USB drive to see if you can now add or delete files.

Step 3: Disable Write Protection in the Windows Registry

If Diskpart did not work, Windows might have a system-wide registry key blocking external storage devices from writing data. You can disable this restriction manually.

  • Press Windows Key + R, type regedit, and press Enter to open the Registry Editor.
  • Navigate to the following folder path in the left sidebar: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
  • Look for a folder named StorageDevicePolicies. If you do not see it, right-click the "Control" folder, hover over "New", select "Key", and name it "StorageDevicePolicies".
  • Click on the "StorageDevicePolicies" folder. In the right-hand pane, look for a file named WriteProtect. If it is not there, right-click the empty space, select "New", then "DWORD (32-bit) Value", and name it "WriteProtect".
  • Double-click the WriteProtect file, change the Value Data to 0, and click OK.
  • Restart your computer and test your USB drive.

Step 4: Repair Disk Permissions on a Mac

If you are using macOS, the write-protection issue is usually caused by a drive formatted in NTFS (which Macs can read but cannot write to by default) or a corrupted file system. You can easily fix file system errors using Disk Utility.

  • Press Command + Spacebar, type Disk Utility, and open the application.
  • Select your USB flash drive from the left sidebar.
  • Click the First Aid button at the top of the window, then click Run. Mac will scan the drive for errors and automatically repair any software locks.
  • If the drive is formatted in NTFS and you need to use it across both Mac and Windows, click Erase at the top of Disk Utility and reformat it as ExFAT (note: this will erase all existing data on the drive).

How to Know If Your USB Drive is Dead

If you have tried all the steps above and the drive remains obstinately write-protected, the USB drive's internal flash memory controller has likely failed. When flash memory chips reach the end of their lifespan or detect physical damage, they automatically lock into a permanent read-only state to prevent data corruption. In this case, you can still copy your files off the drive to back them up, but the drive itself must be replaced.

← Explore more solutions