How to Disable Write Protection on a Pendrive (USB Flash Drive)

Write protection on a pendrive stops you from adding, editing, or deleting files — and it can appear without warning. Before you can fix it, you need to understand why it's there, because the cause determines the correct solution.

What Write Protection Actually Means

When a USB drive is write-protected, the operating system blocks any write operations to the device. You might see error messages like "The disk is write protected" or "This volume is read-only" when trying to copy files or format the drive.

Write protection exists for legitimate reasons — preventing accidental data deletion or blocking malware from spreading via USB. The problem is it sometimes activates unintentionally, or persists after it's no longer needed.

Why a Pendrive Becomes Write-Protected

There are three main sources of write protection, and they require completely different fixes:

1. Physical write-protect switch Some USB drives — particularly older models and SD card adapters — have a small physical slider on the side. When this switch is in the "locked" position, the drive is hardware-protected. No software fix will work until you move it.

2. Registry or system settings (Windows) Windows can apply write protection at the software level through registry entries or disk policies. This can happen after a system update, a security tool change, or sometimes seemingly at random.

3. Drive-level or partition attributes The drive itself may have a read-only attribute set on its partition or volume — visible and changeable through disk management tools like diskpart.

4. Corrupted or failing hardware Some drives enter a permanent read-only state as a self-protection mechanism when the NAND flash memory begins to fail. In these cases, write protection is a symptom of a dying drive — not a setting to toggle.

Method 1: Check the Physical Switch First 🔍

Before touching any software settings, physically inspect the drive. Run your finger along all four sides and look for a small switch or slider. If you find one in the locked position, move it to the unlocked position, safely eject the drive, and reinsert it.

On SD cards used in a USB adapter, this switch is almost always present on the left side of the card itself — not the adapter.

Method 2: Remove Write Protection Using Diskpart (Windows)

Diskpart is a built-in Windows command-line tool that can clear the read-only attribute from a drive or partition.

  1. Press Windows + R, type cmd, and run it as Administrator
  2. Type diskpart and press Enter
  3. Type list disk — identify your USB drive by its size
  4. Type select disk # (replace # with your drive's number)
  5. Type attributes disk clear readonly
  6. Type exit

After running this, safely remove and reinsert the drive and test whether files can now be written.

⚠️ Important: Make absolutely sure you select the correct disk number. Selecting the wrong disk and modifying it can cause serious data loss.

Method 3: Edit the Windows Registry

If diskpart doesn't resolve the issue, the problem may be in the Windows Registry under the StorageDevicePolicies key.

  1. Press Windows + R, type regedit, and open the Registry Editor
  2. Navigate to: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlStorageDevicePolicies
  3. Double-click WriteProtect in the right panel
  4. Change the value from 1 to 0
  5. Click OK and restart your computer

If the StorageDevicePolicies key doesn't exist, you can create it manually — though its absence typically means the registry isn't the source of your problem.

Method 4: Use Disk Management or Format the Drive

If the drive's partition is flagged as read-only and diskpart hasn't resolved it, formatting the drive will clear all partition attributes — along with all data. Only do this when you no longer need the existing files, or have already backed them up.

On Windows, right-click the drive in File Explorer → Format → choose FAT32 or exFAT depending on your use case.

On macOS, open Disk Utility, select the drive, and use the Erase function. macOS handles write-protection differently and doesn't use the same registry structure — but it will recognize hardware-level protection and report the drive as read-only in Disk Utility.

On Linux, use fdisk or GParted to inspect the drive's attributes and remove the read-only flag if it's set at the partition level.

When the Drive Itself Is the Problem

SymptomLikely CauseFix Available?
All methods tried, still read-onlyNAND memory failureUsually no
Drive recognized but won't formatFirmware corruptionSometimes, via manufacturer tool
Drive works on one PC, not anotherOS-level policy conflictYes — check registry/diskpart
Physical switch present, in locked positionHardware lockYes — move switch

Some low-cost or aging drives enter a permanent read-only state as a last-ditch effort to preserve data before complete failure. If you're at this stage, priority one is recovering your data — not fixing the write protection.

Variables That Change the Outcome

The right fix depends on several factors that only you can assess:

  • Your operating system — the registry method is Windows-only; macOS and Linux use different tools entirely
  • The drive's age and brand — some manufacturers provide proprietary format/repair utilities that override standard OS tools
  • Whether data on the drive matters — formatting is the nuclear option that guarantees write access but destroys existing files
  • Your technical comfort level — editing the registry carries risk if done carelessly; diskpart requires careful attention to disk numbers

The cause of your write protection — hardware switch, software policy, partition attribute, or hardware failure — ultimately determines which approach will work for your specific drive and setup.