PC Buyer Beware!

How to recover USB flash drives and devices that become stuck in read-only, write-protected mode

PROBLEM: Three standard 16GB or 32GB USB flash drives I own have mysteriously made themselves read-only write-protected. They can’t even be formatted. The files on them can be seen but can’t be deleted, moved or updated. When I try any of those actions, a message comes up saying that the write-protection has to be removed in order to continue.

ANSWER: Flash drives (aka thumb drives and several other names) or any other type of device that uses flash memory, such as smartphones and cameras, can become inaccessible due to a number of causes. There are also a number of things that can be tried to make them usable again.

Some USB flash drives,especially older models, have a write-protect switch that is usually small and placed where it is least likely to be engaged accidentally, such as the narrow end opposite the connector. Examine the drive and it you find one, push it into its alternative position.

The file attributes of all files on the drives may have somehow been changed to read-only (r), hidden files (h) or been designated as system files (s). You need to make use of the Command Prompt from an Administrator account (not a user account) to change those file attributes into their opposite states of write, unhidden and non-system. In Windows XP, if you are running it from its Administrator account, just enter the command cmd in the Start => Run box to bring up the Command Prompt and then type the following command at the prompt’s > and press Enter. The minus signs remove the attributes. To get them back you would use the command with + signs instead. To find out about all of the switches that the attrib command uses enter attrib /? at the Command Prompt. If the flash drive has been given the letter G (it could be F, H, etc., depending on the number of storage drives the system has) the command is:

attrib -r -s -h G: /d /s

If you need to know how to open a Command Prompt from an Administrator account in Windows Vista, 7 & 8, use the web-search query: open a command prompt in windows Vista/7/8 (use your version of Windows only). Here is a suitable link I found for Windows 7:

http://www.sevenforums.com/tutorials/947-command-prompt.html

If the problem still persists for an affected drive, check the Security settings. From an administrator account, open Windows Explorer by right-clicking on the Start button (or File Explorer in Win8 by typing that name while on the Start screen) and then right-click on USB drive. Select Properties and open the Security tab. Note that to get the Security tab, the drive has to be formatted to use the NTFS file system, not FAT32 or exFAT. All of my flash drives have been formatted to use the FAT32 file system in the factory. To format one to NTFS means having to delete all of the files it contains, so doing that is not an option if you need the files.

The settings are self-explanatory. Every flash drive I have has had its security settings set for unrestricted access by default. If that is not the case, clicking the Edit button allows the settings to be adjusted.

If that measure was unsuccessful, run CHKDSK, the hard-drive diagnostic tool provided by all versions of Windows since XP, which might correct the problem. The best way to do so is to run it from the Command Prompt that you used to change the file attributes, described above. Just enter the command chkdsk /? to be provided with the switches you can use. Just entering chkdsk runs the tool in read-only mode that runs and reports on three tests without being able to make any changes to the drive. Running the command g: chkdsk /r, where Windows has given the flash drive the drive letter G:, finds and fixes most problems automatically. Open My Computer in XP and Computer in Vista and Win7 to find out which drive letter has been assigned to the drive. In Windows 8, from the Start screen, just type computer and then click the link called that that is provided on the new screen that comes up.

If the problem still exists, try modifying the Registry key that controls storage policies. Note that editing the Registry wrongly can render Windows unbootable, so always create a restore point in System Restore before doing so. If Windows can’t boot into normal mode press the F8 key repeatedly at startup to bring up the boot menu that contains Safe Mode and Safe Mode with Networking that allows web access.

If the relevant key, discussed below, has a 0 (zero) setting the drive will be able to read and write data; a setting of 1 makes it read-only.

To open the Registry Editor, enter regedit in the Run box (for XP) and in the Search… boxes for Visa and Win7. In Windows 8, press the Windows key (the one with a flag on it) and the R key to bring up the Run box. Navigate to the following key:

HKEY_Local_Machine => System => CurrentControlSet => Control => StorageDevicePolicies

If the StorageDevicePolicies key is not there, create it by right-clicking Control, then select New/Key and give the new key the name StorageDevicePolicies (exactly as is). In the left-hand pane, select the StorageDevicePolicies key. Right-click on an empty area in the right-hand pane and select New/DWORD, call the new DWORD WriteProtect (exactly as is) and press Enter. Right-click on the new DWORD, click Modify and give it a value of 0 (zero). If StorageDevicePolicies is already on your system, but WriteProtect has a value of 1, right-click on WriteProtect and change the value to 0 (zero). If WriteProtect doesn’t exist, it can be created in the same way described above for the creation of StorageDevicePolicies.

If even that option fails, try the free Apacer LFormat Utility. According to reports on the web, it can format even locked thumb drives.

If none of the above options work, it looks as if all of your flash drives have somehow failed and will have to be replaced. If the files on them must be recovered, there are many file-recovery companies that can be researched on the web. Do your research well, because data-recovery is usually expensive.

It’s a good idea to use a short USB extension cable to connect USB drives to instead of directly to the connectors on the computer, because doing so makes it less likely that damage will be done to the drive when it is removed and the computer’s connectors won’t be used all the time, reducing the chances of damaging them.