How to repair a USB flash drive or an SD card stuck in read only ?.


What is the read-only ?.

The read only is an attribute given to a file to protect it from any change : the file is only available to read.

Some USB keys and SD cards have read-only feature. When it is enabled this means that you can not modify its content (delete/add files).

Sometimes, a USB key or an SD card may end up blocked as read-only, which severely limits the utility.

In this article, we will present three ways to solve this problem.

Note that, depending on the configuration of your USB/SD and its state, it is possible that these different techniques don’t work for you (unfortunately, if your storage media is corrupted or damaged, it will probably have to replace it). Also, hasefore you begin, think of to copy the contents of your USB key or SD card on your computer.

Unlock your USB using Regedit.exe.

All Windows (since XP) have Regedit.exe. Do a search in your Start menu, this will be the first program to be displayed.

In the left column, follow this path :

HKEY_LOCAL_MACHINE\ → SYSTEM → CurrentControlSet → Control → StorageDevicePolicies.

In the right column, double click on WriteProtect. A window then opens.

Erase the 1 in the “value data” and replace the number with a 0.

Click Ok to save the change.

Close Regedit and restart your computer.

Plug in again your USB key – it should not be read-only.

Unlock your USB or SD card : StorageDevicePolicies .

If you do not find the folder StorageDevicePolicies in Regedit, you can create it by doing a right click in the right-hand column of the “Control Folder”.

Choose “New” → “Key” and name it there,”StorageDevicePolicies”

Double click on this new folder, then right click and choose “New” then “DWORD”.

Name the “WriteProtect” and in “Value” enter 0.

Click OK, close Regedit and restart your computer.

Use Diskpart to unlock your USB or SD card.

Plug in your USB stick and launch a command prompt. To do this, locate cmd.exe in the Start menu (or for Windows 8 on the home page).

Make the following entries (except the parentheses), and don’t forget to press enter between each command :


list disk

(In the list of disks that appear, you should recognize your USB stick by its size. A number associated with it. For example, Disk 0. In the following command replace the X with the number associated with your USB)

select disk X

attributes disk clear readonly


create partition primary

format fs=fat32 (you can change fat32 for ntfs if you only use your USB key with Windows)