Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

0x80070024 Media Is Write Protected: Fix Guide

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

When you see the 0x80070024 error, it means Windows cannot write to the storage device because it is write-protected. This protection can be a physical switch, a registry setting, or a disk attribute. The fix depends on the cause, but you can usually resolve it by checking the lock switch, clearing the read-only attribute, or editing the registry. Follow the steps below in order—most fixes are quick and safe, but some require administrative rights.

What You'll Need

  • A Windows PC with administrator access
  • The write-protected device (USB drive, SD card, or external hard drive)
  • If the device is an SD card or USB drive, check for a physical lock switch

Step-by-Step

  1. Check for a physical write-protect switch. Look on the side or bottom of the USB drive or SD card adapter. If there is a small switch, slide it to the unlocked position (usually away from the "lock" icon). Try the device again.
  2. Run Diskpart to clear the read-only attribute. This works for most storage devices.
    1. Press Windows + X and select Terminal (Admin) or Command Prompt (Admin).
    2. Type diskpart and press Enter.
    3. Type list disk and press Enter. Note the disk number of your device (e.g., Disk 1). Be careful—do not select the wrong disk.
    4. Type select disk X (replace X with the number) and press Enter.
    5. Type attributes disk clear readonly and press Enter.
    6. Type exit and press Enter.
  3. Clear the read-only attribute on the volume. If the disk attribute is already clear, try the volume level.
    1. In Diskpart, after selecting the disk, type list volume and press Enter.
    2. Type select volume X (replace X with the volume number) and press Enter.
    3. Type attributes volume clear readonly and press Enter.
    4. Type exit and press Enter.
  4. Edit the registry to disable write protection. This is for devices that still show the error after Diskpart.
    1. Press Windows + R, type regedit, and press Enter.
    2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies. If the StorageDevicePolicies key does not exist, right-click on Control, select New > Key, and name it StorageDevicePolicies.
    3. In the right pane, look for a DWORD named WriteProtect. If it exists, double-click it and set its value to 0. If it does not exist, right-click, select New > DWORD (32-bit) Value, name it WriteProtect, and set its value to 0.
    4. Click OK, close Regedit, and restart your PC.
  5. Format the device (last resort). If the above steps fail and the device has no important data, you can format it to remove the protection.
    1. Open File Explorer, right-click the drive, and select Format.
    2. Choose a file system (FAT32 for USB drives under 32GB, exFAT for larger drives), set the allocation unit size to default, and check Quick Format.
    3. Click Start. This will erase all data on the device.

Common Mistakes

  • Selecting the wrong disk in Diskpart. This can wipe your system drive. Always verify the disk number and size before selecting.
  • Forgetting the physical lock switch. Many SD card adapters have a tiny switch that is easy to miss.
  • Skipping the registry edit. If Diskpart does not work, the registry is often the culprit, but many users stop too early.
  • Formatting without backing up. Formatting erases everything—only do this if you are sure you do not need the data.

Tips

  • Always eject the device safely before removing it to avoid future write-protection issues.
  • If the device is an SD card, try using a different adapter—sometimes the adapter's lock switch is faulty.
  • For USB drives, try a different USB port or computer to rule out a port issue.
  • Run chkdsk X: /f (replace X with the drive letter) to fix file system errors that might cause the error.

Troubleshooting

If the error persists after following all steps:

  • Try a different computer. Some devices have hardware-level write protection that only a manufacturer's tool can remove.
  • Check if the device is physically damaged. A broken USB connector or a worn-out SD card can trigger this error. If the device is old, it may be failing.
  • Use the manufacturer's utility. Many brands (SanDisk, Kingston, etc.) offer free formatting tools that can reset the device. Search the official website for your model.
  • If the device is a USB drive and still write-protected after all steps, it may be permanently locked. Some drives have a firmware-level write-protect that cannot be removed. In that case, the drive is likely dead—replace it.

Frequently Asked Questions

Why does my USB drive suddenly become write-protected?

Common causes include a physical lock switch, a registry setting, or the drive's own controller deciding to protect itself due to errors or age.

Can I recover data from a write-protected drive?

Yes, you can usually read data from a write-protected drive. Copy files to another location before attempting any fixes, especially before formatting.

Will formatting remove write protection?

Formatting can remove write protection if the issue is logical, but it will not work if the drive has a hardware lock or the controller is damaged.

Is it safe to edit the registry to fix this error?

Editing the registry is safe if you follow the steps carefully and only change the specified key. Always back up the registry before making changes.

Does this error occur on SD cards too?

Yes, the 0x80070024 error is common on SD cards, especially when the lock switch on the adapter is engaged.

What if Diskpart says "disk attributes cleared successfully" but the error persists?

Try restarting your PC and reconnecting the device. If it still fails, try the registry method or check for a physical switch again.