How to Remove Write Protection from a USB Drive (Windows 11 and Mac)

“The disk is write protected.” If Windows shows that message when you try to copy, delete or format files, you can usually fix it in a few minutes. This guide shows how to remove write protection from a USB drive on Windows 11 and Mac, from the simple lock switch to Diskpart and the registry, and how to tell when the drive itself is failing.

remove write protection from a USB drive plugged into a laptop

Quick answer: First check for a lock switch on the USB drive or SD card adapter and slide it to unlocked. On Windows, open Command Prompt as administrator and run diskpart, then list disk, select disk N (your USB drive) and attributes disk clear readonly. If that fails, set WriteProtect to 0 in the registry key StorageDevicePolicies. On a Mac, NTFS drives are read-only by default, so copy your files off and reformat as exFAT. A drive that stays read-only after all this is usually worn out.

Why is my USB drive write protected?

  • A physical lock switch on the drive, SD card or microSD adapter is set to Lock.
  • A read-only attribute is set on the disk in Windows.
  • A registry or Group Policy setting blocks writing to removable drives, common on work or school PCs.
  • The file system isn’t writable on your computer, such as an NTFS drive on a Mac.
  • Errors or corruption on the drive.
  • The flash memory is wearing out. Many USB drives switch themselves to read-only when the memory chips start to fail, to protect your data.

1. Check the lock switch

Look along the side of the USB drive or SD card adapter for a small slider. Unplug the drive, slide it away from “Lock” and plug it back in. On SD adapters the switch is easy to knock while inserting the card, so check it even if you never touched it.

2. Remove write protection with Diskpart (Windows 11 and 10)

  1. Plug in the USB drive and note its size in File Explorer.
  2. Press the Windows key, type cmd, right-click Command Prompt and choose Run as administrator.
  3. Type diskpart and press Enter.
  4. Type list disk. Find your USB drive by its size.
  5. Type select disk 2, replacing 2 with your USB drive’s number. Double-check the number; choosing the wrong disk can affect your main drive.
  6. Type attributes disk clear readonly. You should see “Disk attributes cleared successfully.”
  7. Type exit, then unplug and replug the drive and try copying a file.

If the drive still won’t work and you don’t need its contents, you can wipe and reformat it in the same Diskpart session after selecting the disk: clean, create partition primary and format fs=exfat quick. This erases everything on the drive. Our guide to formatting a USB flash drive on Windows 11 and Mac explains the formatting options.

3. Remove write protection in the Registry

A registry setting can make every USB drive read-only. Back up the registry or create a restore point before you edit it.

  1. Press Windows + R, type regedit and press Enter.
  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies.
  3. If you see a value named WriteProtect, double-click it and change its value data to 0.
  4. Click OK, close Registry Editor and restart the PC.

If the StorageDevicePolicies key doesn’t exist, this isn’t your problem; leave the registry alone and move to the next step.

4. Check Group Policy (Windows Pro)

  1. Press Windows + R, type gpedit.msc and press Enter.
  2. Open Computer Configuration > Administrative Templates > System > Removable Storage Access.
  3. Find Removable Disks: Deny write access. If it says Enabled, set it to Not Configured or Disabled.
  4. Restart the PC.

On a work or school computer, this policy is usually set by your IT team on purpose. Ask them rather than changing it.

5. Scan and repair the drive

  • Run a malware scan on the drive with Windows Security (right-click the drive > Scan with Microsoft Defender).
  • Check for errors: right-click the drive in File Explorer > Properties > Tools > Check. Our guide to fixing USB flash drive errors covers more repair steps.
  • If you see “Directory or file cannot be created” instead, read the fix for error 0x80070052 on USB flash drives.

How to remove write protection from a USB drive on Mac

  • NTFS-formatted drives: macOS can read NTFS (the usual Windows format) but not write to it, so the drive looks read-only. Copy your files off, then open Disk Utility, select the drive, click Erase and choose ExFAT, which works on both Mac and Windows.
  • Permissions: select the drive in Finder, press Command + I, and under Sharing & Permissions tick Ignore ownership on this volume (click the lock to make changes).
  • Errors: in Disk Utility, select the drive and run First Aid.
  • Lock switch: SD card adapters used in Macs have the same lock slider.

When the USB drive is failing

If the drive is still read-only after every step above, and the same thing happens on another computer, the flash memory has probably worn out. Many drives deliberately lock themselves in read-only mode at the end of their life so you can still copy your files off. Back up everything you need straight away, then replace the drive. No software can safely make a worn-out drive writable again, and tools that promise to are best avoided.

FAQ

How do I remove write protection from a USB drive in Windows 11?

Run Command Prompt as administrator, then diskpart, list disk, select disk N and attributes disk clear readonly. Check the lock switch and the WriteProtect registry value too.

Can I format a write-protected USB drive?

Not until you remove the write protection. Clear it with Diskpart first, then format.

Will removing write protection delete my files?

No. Clearing the read-only attribute or the registry setting keeps your files. Only the clean and format commands erase the drive.

Why is my USB drive write protected on Mac?

Usually because it’s formatted as NTFS, which macOS can’t write to. Reformat it as exFAT after copying your files off.

Photo by Brina Blum on Unsplash

Found this useful? Share it with someone who needs it.

Fresh Tech Guides

Leave a Reply

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