The disk is write-protected 🪟 Windows

The media is write protected / The disk is write-protected (USB or SD card)

Windows refuses to write to the drive because a hardware lock, a read-only attribute, a policy, or a failing flash device is in effect.

Seen on: Windows

Meaning

SD adapters have a physical lock switch. Disks can be marked read-only by diskpart, by a registry/USB policy (StorageDevicePolicies) or by BitLocker To Go/endpoint security. Worn-out flash drives often switch to permanent read-only mode.

Common causes

  • Physical lock switch on SD card/adapter
  • Read-only attribute set (diskpart)
  • WriteProtect policy in registry/GPO
  • Failing USB flash drive in read-only mode

⚡ Quick fix

  1. Check the lock switch
  2. diskpart attributes disk clear readonly
  3. Check the StorageDevicePolicies WriteProtect value

Detailed fix by platform

Windows

  1. powershell
    diskpart
      list disk
      select disk 2
      attributes disk clear readonly
      exit
    reg query HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies

How to diagnose

  1. Switch — Lock position
  2. Attributes — diskpart attributes disk
  3. Policy — WriteProtect value / endpoint security

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.