This comprehensive guide explains the "the disk is write protected" error and provides step-by-step solutions to remove the disk is write protected. We cover methods using DiskPart, Registry Editor, and physical switches for USB drives and SD cards, helping you regain full control of your storage device.
USB: "This disk is write-protected."
I hate this a lot. I tried editing the Registry Editor and the command prompt, but nothing worked. The error only prompts with some specific files. This USB worked properly on my laptop months ago, btw.
- Question from learn.microsoft.com
Suffering from the same pain while using your disk, SD Card, USB flash drive, or other devices? Don’t worry, you can find effective solutions to fix it quickly and protect your files now. Let’s find out.
You might encounter different errors while using your devices, like:
Regardless of the error message, you have solutions to fix it. Please keep reading.
At its core, the "The disk is write protected" error is a safety feature, not a glitch. It’s designed to prevent accidental deletion or modification of important files. This protection can be triggered in several ways:
Before you dive into complex software fixes, it's essential to rule out the simplest explanations first. A few quick checks can save you a world of hassle.
Generally speaking, manufacturers include a small physical lock on an SD Card or some older USB drives for a very good reason: to prevent you from accidentally deleting your photos or videos.
For an SD card, look closely at the left side. You’ll see a small, often black or white, slider. When the slider is pushed down towards the bottom of the card (often towards the gold contacts), it’s in the “Lock” position. Slide it up into the “Unlock” position. It’s that simple.
For certain USB drives, particularly older models, a similar switch might exist on the housing. Run your finger along the sides to feel for it. If you find one, toggle it, safely eject the drive, plug it back in, and see if the error persists. This is the fastest way to remove the disk's write protected status.
If the physical switch isn’t the issue, the next likely suspect is file system corruption. When Windows detects that the file system is in an unstable state, it might put a read-only lock on the drive to prevent further damage. The Windows built-in utility, CHKDSK can scan for and attempt to repair these errors.
Remove write protection for your SD Card, USB flash drive, or other disks according to the steps below:
1. Search for "cmd" in the Windows search box, right-click Command Prompt, and select Run as administrator.
2. Then, type chkdsk G: /f /r (replace “G” with the actual letter of your write-protected drive) and press Enter.
If CHKDSK finds and repairs corruption, it may automatically remove the disk's write-protected flag. Allow the process to complete; it can take some time for larger drives.
DiskPart gives you low-level control over your disks and partitions, and it’s often capable of clearing write protection that standard formatting can’t touch.
1. Open Command Prompt as an administrator.
2. Type diskpart and press Enter. You’ll now be in the DiskPart environment. Carefully enter the following commands, pressing Enter after each one:
list disk (This shows all storage devices connected to your PC. Identify your write-protected disk by its size. Be very careful to select the correct one!)
select disk X (Replace “X” with the number of your disk from the previous list.)
attributes disk clear readonly (This is the magic command that clears the read-only attribute.)
3. Once you see "Disk attributes cleared successfully", then exit DiskPart.
4. Safely eject the drive and reconnect it.
The error should now be gone, allowing you to format or use the drive normally.
In some cases, a setting in the Windows Registry can enforce write protection on all removable drives. This is common in managed corporate environments, but can sometimes be activated by mistake on personal computers.
Important:
1. Press Windows Key + R, type regedit, and press Enter to open the Registry Editor.
2. Navigate to the following key by expanding the folders in the left pane:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies
3. If you see the StorageDevicePolicies key, look in the right pane for a value called WriteProtect. If it exists and its value is set to 1, that’s the cause of your problem.
4. Double-click WriteProtect and change its value to 0. Click OK.
If the StorageDevicePolicies key doesn’t exist, you likely don’t have this particular issue. Do not create the key unless you are certain it's necessary.
After making the change, close the Registry Editor, restart your computer, and check the drive. This can resolve the "this disk is write protected" message on the USB.
If your disk is full, you can’t write data to it. So, please check the available space on your disk. To do this:
1. Please double-click This PC on your computer to open Windows File Explorer.
2. Click This PC, and it will show all disks on your computer.
3. Find your disk, then it will show this: **GB free of ** GB. Additionally, if the red progress indicator appears, it indicates that your disk is full or has insufficient space.
If it’s full, please free up space on that disk, then use it normally. It’s highly recommended to back up files in case of data loss.
If nothing works, you have to use professional data recovery software to recover precious files immediately in case of data loss. Fortunately, you can use MyRecover to recover files from a write-protected disk easily.
With MyRecover, you can enjoy the following advantages:
Thus, how to recover files from a write-protected disk with MyRecover:
1. Connect your SD Card, USB, or other disks that show “The disk is write protected”, and ensure it can be detected. Download and install MyRecover, then launch it.
2. Tap Disk Data Recovery, point to the write-protected disk, and hit Scan.
3. Wait for the scanning to complete, and hit OK.
4. Select the files and tap Recover.
5. Choose a location and hit Select Folder to save these recovered files, not the write-protected disk.
H4: What does it mean when my SD card says "the disk is write-protected"?
A: It means your SD card is in a read-only state to prevent data changes. This is usually caused by the physical lock switch on the card's side being slid into the "lock" position. If the switch is already unlocked, the card's file system is likely corrupted, prompting Windows to enforce protection. You'll need software like CHKDSK to repair it.
H4: How can I permanently remove write protection from my USB drive?
A: Permanence depends on the cause. Software-based protection can often be removed for good using DiskPart's attributes disk clear readonly command. However, if the drive has a physical lock switch, you must keep it unlocked. If the drive is failing, the protection may be permanent, as a safety measure by the drive itself.
H4: Why can't I format my write-protected disk even after using DiskPart?
A: DiskPart failure points to a deeper issue. You may have selected the wrong disk, the drive may have a critical hardware failure, or a Group Policy on a work computer may be overriding your commands. If all software solutions fail, the drive is likely physically damaged and needs replacement.
H4: Is it safe to edit the Windows Registry to fix write protection?
A: It can be safe if you are precise, but it is risky. The Registry is critical to Windows. A mistake can cause system instability. Always back up the Registry before making changes and follow instructions exactly. For most users, trying safer methods like DiskPart first is recommended.
H4: Can a virus cause a disk to become write-protected?
A: Yes, malware can cause this. Some viruses modify registry settings to lock your USB drives, hindering disinfection. If you suspect an infection, run a full system scan with a reputable antivirus program before attempting other fixes. Cleaning the virus may resolve the issue.
H4: My SD card is write-protected, but the lock switch is broken. What should I do?
A: A broken switch is a common hardware problem. You can try placing a small piece of tape over the switch slot to mimic the "unlocked" position. Alternatively, use an older card reader that ignores the lock switch entirely to format the card. If these tricks fail, the card likely needs replacing.
Until now, you have fixed “The disk is write-protected” error on your disk, SD card, USB flash drive, or other devices. If you can’t access files on the write-protected disk, MyRecover will do you a big favor, which is to recover all files from the disk easily. Besides, MyRecover recovers files from a formatted SSD, SD card, a RAW partition, etc.