Smart Systems for Home

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

Fix Disk Is Write Protected Errors: Step-by-Step

· 7 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 a “disk is write protected” error, it means your drive (USB stick, SD card, or internal storage) is set to read-only mode, so you can’t copy, delete, or format files on it. This is usually caused by a physical lock switch on the drive, a registry setting on Windows, or a corrupted file system. Below are the exact steps to remove write protection and regain full access to your drive.

What You'll Need

  • The affected drive (USB, SD card, or external hard drive) plugged into your computer.
  • Administrator access on your Windows PC (you’ll need to allow changes).
  • A second computer or a different USB port for troubleshooting (optional but helpful).
  • Backup of any important data on the drive, if possible (some steps may erase it).

Step-by-Step

  1. Check for a physical lock switch. Look at the side or bottom of your USB stick or SD card adapter. Many have a tiny sliding switch labeled “Lock” or with a padlock icon. Slide it to the unlocked position (usually away from the “Lock” label). If there’s no switch, move to the next step.
  2. Try a different USB port or computer. Plug the drive into another port on your PC, or into a different computer. Sometimes a faulty port or driver can cause a false write-protection error. If the drive works elsewhere, the issue is with your original port or system.
  3. Run DiskPart to clear the read-only attribute (Windows). This is the most common fix. Press Windows + R, type diskpart, and press Enter. If prompted by User Account Control, click “Yes.” In the DiskPart window, type the following commands one at a time, pressing Enter after each:
    • list disk — note the disk number of your write-protected drive (e.g., Disk 1).
    • select disk X — replace X with the actual number (e.g., select disk 1).
    • attributes disk clear readonly — this removes the read-only flag.
    • exit — to close DiskPart.
    Try copying a file to the drive again. If it still says write-protected, proceed.
  4. Edit the Windows registry (if DiskPart didn’t work). Some drives have write protection enabled via the registry. Press Windows + R, type regedit, and press Enter. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies. If the “StorageDevicePolicies” key doesn’t exist, right-click on “Control,” select “New” > “Key,” and name it StorageDevicePolicies. Inside that key, look for a DWORD value called WriteProtect. If it exists, double-click it and set its value to 0. If it doesn’t exist, right-click on the empty area, select “New” > “DWORD (32-bit) Value,” name it WriteProtect, and leave its value as 0. Close the registry editor and restart your PC.
  5. Format the drive (only if you don’t need the data). If the above steps don’t work, the drive’s file system may be corrupted. Open File Explorer, right-click on the drive, and select “Format.” Choose a file system (FAT32 for USB sticks under 32GB, exFAT for larger drives or cross-platform use, NTFS for Windows-only). Uncheck “Quick Format” if you want a full format, but note that a full format takes longer. Click “Start.” If formatting fails due to write protection, try using DiskPart’s clean command (but this erases everything): in DiskPart, after selecting the disk, type clean, then create partition primary, then format fs=fat32 quick (or exFAT).
  6. Check for drive encryption or third-party software. Some USB drives come with built-in encryption or security software that locks the drive. Check if the drive has a manufacturer’s utility (e.g., for SanDisk, Kingston, or Lexar) that can disable write protection. Also, if you use any disk encryption software (like BitLocker or VeraCrypt), ensure the drive is properly unlocked and not set to read-only.

Common Mistakes

  • Forgetting the physical lock switch. The most common cause is a tiny switch that gets bumped. Always check this first.
  • Selecting the wrong disk in DiskPart. If you select the wrong disk number, you could clear attributes on your system drive, causing boot issues. Double-check the disk number and size before running attributes disk clear readonly.
  • Editing the registry without creating a backup. A wrong registry edit can break Windows. Always export the key before changing it: right-click on “StorageDevicePolicies” and select “Export” to save a backup.
  • Trying to format a drive that still has a physical lock on. Formatting will fail if the lock is still engaged. Always verify the lock first.
  • Using a USB hub or extension cable. These can cause power or communication issues that mimic write protection. Plug directly into the computer’s USB port.

Tips

  • Back up your data before attempting any fix. Even if the drive is write-protected, you can often still read files. Copy important data to another drive before trying to clear the protection.
  • Use DiskPart carefully. The clean command wipes the entire disk, including all partitions. Only use it if you’re sure you don’t need anything on the drive.
  • Try a different file system. If you’re using the drive with a camera or game console, FAT32 or exFAT is usually more compatible than NTFS.
  • Keep your USB drive dry and clean. Dirt or moisture on the contacts can cause read/write errors. Use a soft cloth to clean the metal contacts.
  • If the drive is old, consider replacing it. Write protection can be a sign of failing flash memory. If the drive is more than a few years old, it may be safer to get a new one.

Troubleshooting

If the steps above didn’t work, try these in order:

  1. Restart your computer. A simple reboot can clear temporary glitches that cause write protection.
  2. Update your USB drivers. Go to Device Manager (right-click the Start button), expand “Disk drives,” right-click your drive, and select “Update driver.” Choose “Search automatically for drivers.”
  3. Try the drive on a different operating system. If you have access to a Mac or Linux machine, plug the drive in and see if you can write to it. If it works there, the issue is Windows-specific.
  4. Check if the drive is dying. If the drive makes clicking noises, is extremely slow, or shows other errors, it may be physically failing. In that case, stop using it and try to recover data with professional software or a data recovery service.
  5. Use the manufacturer’s repair tool. Many major brands (SanDisk, Kingston, Samsung) offer free formatting or repair utilities on their websites. Download the official tool for your drive model and run it.
  6. If nothing works, the drive may be permanently locked. Some drives have a controller that fails and locks the drive to read-only. In this case, you can only read data, not write. Consider replacing the drive.

Frequently Asked Questions

Why does my USB stick suddenly become write-protected?

It’s often a physical lock switch, but it can also be a corrupted file system, a failed firmware update, or the drive reaching the end of its lifespan. The steps above cover the most common causes.

Will formatting remove write protection?

Sometimes yes, but only if the write protection is due to a corrupted file system. If the drive’s hardware or registry is locked, formatting will fail with the same error. Clear the read-only attribute first (Step 3), then format.

Can I recover data from a write-protected drive?

Yes, you can usually read data from a write-protected drive. Copy files to another drive before attempting any fixes. If the drive is physically failing, use data recovery software like Recuva or PhotoRec, but stop using the drive immediately if you hear clicking noises.

Is the registry edit safe?

It’s safe if you follow the steps exactly and only change the WriteProtect value to 0. Always back up the registry key first. If you’re uncomfortable editing the registry, skip that step and try other methods.

My SD card has a lock switch, but it’s already unlocked. What now?

Try cleaning the metal contacts with a soft cloth. If that doesn’t work, use the DiskPart method (Step 3) or try formatting in a camera or phone. Some SD cards have a small internal switch that can get stuck; gently sliding the lock back and forth a few times may help.

What does “read-only” mean?

Read-only means you can view and copy files from the drive, but you cannot modify, delete, or add new files. The drive’s file system is set to prevent any changes, which is exactly what the write-protected error indicates.