"The disk is write-protected": how to fix a USB stick or SD card you can't write to
You try to copy a file or format the stick and get "The disk is write-protected" or "Media is write protected". Sometimes it's a tiny switch, sometimes a setting, and sometimes the flash has worn out and locked itself to protect your files.
Find out which kind it is
| Sign | Most likely cause | Can it be fixed? |
|---|---|---|
| SD card, read-only everywhere, lock slider pushed down | The physical lock | Yes: slide it up towards the contacts |
| Read-only on one computer, fine on another | A setting on that computer (registry, policy, encryption rule) or its card reader misreading the switch | Yes, on that computer |
| Only NTFS drives are read-only, and only on a Mac | macOS reads NTFS but doesn't write it | Yes: see read-only on a Mac |
| Read-only on every computer, format fails, files still open | The controller has locked itself read-only because the memory is worn out or failing | No, but the files can usually still be copied off |
| Files copy, but later turn out corrupted past a certain amount | A fake-capacity stick that reports more space than it has | Not really: test it with H2testw or f3 and replace it |
The lock switch
Full-size SD cards have a small slider on the left edge. Down, towards the label end, is locked; up towards the metal contacts is unlocked. microSD cards have no switch, but the full-size adapter does, and it can slide as you push it into a reader. Some laptop card readers misread the switch too: if the card works in a USB card reader or another computer, the laptop's reader is the problem, not the card. A few USB sticks have a lock switch on the side.
Clear the read-only flag (Windows)
Open Command Prompt as administrator and run:
diskpart list disk select disk 2 (the number of the stick: check the size!) attributes disk attributes disk clear readonly exit
If attributes disk showed "Current Read-only State: Yes" and clearing it works, try copying a file again. If it's back to read-only after unplugging and replugging, the stick itself is reporting read-only, which points at the switch or worn-out flash. There's also a per-partition flag: list volume, select volume N, attributes volume clear readonly.
Settings that block writing
- Registry: in
regedit, go toHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies. If there's aWriteProtectvalue, set it to0and restart. If the key doesn't exist, this isn't the cause. - Policy: on work or school computers, "Removable Disks: Deny write access" (Group Policy > Administrative Templates > System > Removable Storage Access), or a BitLocker rule that only allows writing to encrypted sticks, makes every USB stick read-only. That's deliberate, so ask whoever manages the computer.
- Antivirus or device-control software can block USB writes too; its log will say so.
Mac and Linux
- Mac: select the drive in Finder and press Cmd+I. "You can only read" with the format shown as NTFS is the NTFS limitation. For a locked SD card, check the slider. Disk Utility > First Aid can repair a file system that macOS mounted read-only because of errors.
- Linux:
sudo dmesg | tailright after plugging in shows "Write Protect is on" when the device itself reports read-only. If the kernel says it's writable but the mount is read-only, the file system had errors: unmount it and runfsck.sudo hdparm -r0 /dev/sdXclears a software read-only flag, but can't override the card's own lock.
When the flash has worn out
Flash memory can only be rewritten a limited number of times. When a USB stick or SD card runs out of spare blocks, many controllers switch to permanent read-only on purpose, so you can still rescue what's on it. Dashcams, security cameras and anything that records all day wear cards out fastest. Signs: read-only on every computer, formatting fails or "finishes" without changing anything, and deleted files come back after replugging. No setting fixes this. Copy everything off now (it may stop reading later), then replace it, ideally with a "high endurance" card for cameras. Think about what was on it before throwing it away: a read-only card can't be wiped, so destroy it physically if it held anything private.
Formatting tools
For a card that isn't write-protected but won't format properly, the SD Association's free SD Card Formatter resets it to the standard layout. Formatting can't help a card that has locked itself read-only. For picking a format afterwards, see which format to use.
Related
Test for a fake-capacity stick or card · USB stick not showing up · SD card not detected · Drive read-only on a Mac (NTFS) · "You need to format the disk" · Which format for a USB stick?
Questions
How do I remove write protection from a USB stick?
Check for a lock switch, then in an admin Command Prompt run diskpart, list disk, select disk N, attributes disk clear readonly. Also make sure the WriteProtect registry value under StorageDevicePolicies is 0 and no removable-storage policy is set.
Why does my SD card say it's locked?
The lock slider on the card, or on the microSD adapter, is in the down position, or the computer's card reader is misreading it. Slide it up towards the contacts, or try a USB card reader.
Can a write-protected USB stick be formatted?
Only once the protection is removed. If the stick has locked itself read-only because the flash is worn out, formatting fails or seems to finish without changing anything, and it needs replacing.
Why did my SD card suddenly become read-only?
Usually the memory has reached the end of its life, especially in dashcams and cameras that write constantly. The controller locks the card read-only so the files can still be copied off.
Is a read-only USB stick safe to throw away?
Not if it held private files: it can still be read, and because it can't be written to, it can't be wiped. Copy what you need, then destroy it physically.
Published · updated .