Removing write-protection on bootable flash drive

Status
Not open for further replies.

SleepyzzJohn

Honorable
Dec 6, 2013
18
0
10,510
I used an .iso to make my Kingston DT bootable, but in doing so it also made it write-protected. I used it satisfactorily in that state for several months, but when I wanted to reformat it with a new .iso, unfortunately all my attempts to do this failed.

I more or less wrote that Kingston off as an unfortunate hardware failure, and made a new NX216 8GB stick bootable with my next .iso. Again it worked OK until I came to the point where I wanted to change to a new .iso. Reformatting failed on this one too, which is when I realised my previous Kingston failure must be due to a similar symptom.

Neither my Kingston nor my NX216 have usable partitions and attempts to write a new MBR fail which I guess is because they are being thwarted by write protection. Have tried low-level formatting from command prompt, and regedit change to set StorageDevicePolicies to "0".

Any other suggestions?
 

SleepyzzJohn

Honorable
Dec 6, 2013
18
0
10,510
Diskpart sounded like a credible suggestion, Dereck, so thanks for that, but sorry to say it hasn't got me much further. On both my flashdrives it appeared to clear my readonly attribute successfully, but they are both still saying Windows is unable to complete my quick format requests.

As for trying attributes volume clear readonly, I get a Virtual Disk Service Error saying the operation is not supported on removable media.

My Kingston is showing FAT32 and healthy, while my NX216 is showing RAW and healthy.

I'll persevere with some of the other software I've been trying such as TestDisk, BOOTICE, HDD Low Level Format Tool, EasUS Partition Master, and see if Diskpart's alleged successful clearing of my discs has made any difference.
 
It sounds like you've tried all of the tricks in this article. Nevertheless, I thought that I'd suggest it in case there is some tiny tidbit that you might have missed: http://www.makeuseof.com/tag/how-to-fix-write-protection-errors-on-a-usb-stick/

Good luck!

Yogi
 

SleepyzzJohn

Honorable
Dec 6, 2013
18
0
10,510
Mmm... yes, that's not a bad article, Yoggi, but as you suggest, I find I've pretty much tried all those tricks. Thanks anyway.

The difference with my two write-protected flashes, which nothing I've found on websearches so far seems to address, is that I burned them both from .iso myself, which presumably replaced their boot files and deliberately made them read-only. Later after using them successfully for quite a while like that, I tried to reformat them. This somehow removed all my .iso originated main partition
body content in them so they are both now empty, but it left them unwriteable. Whether they've got something that makes them unwriteable in their boot sector, or whether there's something even deeper down inside them causing that, I don't know.

I don't suppose I'm the first person in the world to have tried using flashdrives instead of CDs or DVDs to burn bootable programmes on to, so I'd like to hear from anyone who's done that and then gone on later to try and reformat them like I have.

Basic question: Is it possible to recycle flashdrives and burn them again with another .iso after they've already been used once that way?? .
 

SleepyzzJohn

Honorable
Dec 6, 2013
18
0
10,510
OK, I'll try this, but it's too early to call it a "solution" (which someone has done) just now because we've no idea whether it will be successful, and in any case at best it could only be half a solution because I have two stuck flashdrives and only one of them is a Kingston. It is misleading to have marked this question as "solved" right now. I'm still hoping I might get a response to my basic question above [repeat] Is it possible to recycle flashdrives and burn them again with another .iso after they've already been used once that way?? .[/repeat]
 


Yes, I do it often (with a HP USB flashdrive).
That link that YOGI gave listing the 7 different ways to fix USB drives works 99% of the time.
It's possible that your problems are because of the software you used to burn the .iso files to your drives. Try using another one next time.




 

SleepyzzJohn

Honorable
Dec 6, 2013
18
0
10,510
Good to know recycling is possible and you've been doing it, Dereck. That's significant news. I've been burning from Linux's built-in "Make Startup Disk" because I'm trying to move away from Windows altogether. I suppose it's possible this sw might be responsible, but I'm afraid I don't feel like risking a "next time" and possibly ruining a third flash until I've got to the bottom of what;'s happened to my first two.
 

tkk

Honorable
Dec 24, 2013
1
0
10,510
Hi

If you find write-protected in flash drive , the way remove is to copy the registry entry to a note pad and save pendrive.reg .
Remove the pen drive and click this file , insert and pen drive and read/write


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies]
"Writeprotect"=dword:00000000



 

SleepyzzJohn

Honorable
Dec 6, 2013
18
0
10,510
Hi Tkk. Thanks for the suggestion, but it's one I'd already tried because it was included in the URL Yogi posted here on 7 Dec., Even with "Writeprotect"=dword:00000000 set in registry, the flashdrive still shows writeprotected when I try to make changes to it.

I'm still stuck on this problem though, so any further suggestions would be welcome.
 

SleepyzzJohn

Honorable
Dec 6, 2013
18
0
10,510
Thanks Yogi, that one certainly looks very promising. I'll give it a try and report back here asap.

Kingston Technical Support's 2nd reply was a disappointingly standard set of response sentences taken from their call-centre phrase book, but I've gone back with a request for more specialised technical dialogue and now await their 3rd reply.

I've had encouraging feedback from other correspondents besides Dereck here, saying they have successfully reformatted flash drives they've previously made bootable, but using different brands from mine, so I'm not sure if there's a proprietary "some can" and "some can't" issue here or not.
 

SleepyzzJohn

Honorable
Dec 6, 2013
18
0
10,510
I've now tried mUsbFixer from that softpedia URL. Their description certainly sounds great, and it looks to be ridiculously simple, but doesn't work at all because it won't recognise either of my flashes at all. I'm supposed to select the drive to fix from a dropdown box, but nothing ever shows in that box. Even trying on it another known good flashdrive, nothing shows. I've e-mailed the support in India to see if they have any suggestions, but on the face of it, the programme appears to be flawed.

I've also come to the end of the road with KIngston Support. I've been fobbed off with:
We sincerely apologize that Kingston DataTraveler 101 does not officially support boot feature. We neither provide tool/updater nor provide other work around for your issue. Besides, it is possible "write-protection" mean the drive lucks itself since the original structure was affected/attacked from unknown reason.

If any inconvenience may have caused, we sincerely apologize.

Running out of ideas again now


 

awilkins

Distinguished
Apr 2, 2008
1
0
18,510
Have you tried just copying a string of zeroes over the raw block device?

Most OS tools presume that the drive has been formatted with FAT32. Windows in particular can be a bit funny about drives with a partition table on them.

e.g. from Linux

# Where /dev/sdc is your USB thumb... make sure by using fdisk to list your block devices or reading the output of dmesg after you insert it
sudo fdisk -l
# not /dev/sdc1 or any other numbered partition - the root block device
dd if=/dev/zero of=/dev/sdc

A few seconds of the drive light flashing is usually enough for this to work - you can quit the command with ctrl-C and remove / reinsert the drive and format it.
 

SleepyzzJohn

Honorable
Dec 6, 2013
18
0
10,510
Many thanks to awilkins for this suggestion. Yes I had previously tried just copying a string of zeroes over the raw device using BOOTICE but found I could only write them in sectors 48 upwards. I couldn't write in sectors 0 to 47. I could see sectors 8 to 47 had largely FF in them.

So I've been trying your suggested dd if=/dev/zero of=/dev/sdb and seem to be making some limited progress, but the situation is rather complicated and confused because I now have three failed devices, each exhibiting different failure symptoms. I'm still working on them.

On my 8GB Kingston DT 101 this first step resulted in its disk identifier changing from its previous value to 0x00000000 and it saying it doesn't have a valid partition any more.

As a 2nd step, I tried with "Disk" to format MBR and FAT32. It seemed to go through the motions and changed its disk identifier from 0x00000000 to a new value, but at the end said it didn't have a valid partition table

As a 3rd step I tried mkdosfs -F 32 -I /dev/sdb which worked because when I removed and replugged the device in, it was recognised, showing 358MB used and 7.6GB free. I was able to save three small text files, safely remove the drive, reinsert it, and find the three small text files still there. This looked good, but unfortunately it didn't last.

When I tried to safely remove the drive again, I couldn't because it went into continuous flashing mode and never stopped. When I pulled it out and reinserted it again, it was back to telling me it didn't have a valid partition again. A couple more tries with mkdosfs -F 32 -I /dev/sdxx got it working again but now it was showing 817.6MB used and 7.2MB free. Something had been eating up its free space.

At this point I took it over to Windows and tried it there. Windows said it had 6.67GB free out of 7.44GB, and when I tried to open it, I found an unrecognisable folder with an impossible creation date and a couple of large unrecognisable files that couldn't be deleted. Maybe the FAT formatting I'd done on Linux was being misinterpreted by Windows so I thought I'd try a Windows format. Windows formatting failed and said the device was write protected.

Next step was to have a look using TestDisk. TestDisk told me no partition was bootable. Further examination though, revealed a couple of Linux partitions thus:
Start End Size in sectors
1 * Linux 157 14 50 351 151 56 3125248
Linux 157 177 21 352 59 27 3125248

I can only assume that these Linux partitions were the original bootable ones I burned on to the drive from Linux .iso downloads a couple of years ago and which I've never succeeded in removing by reformatting.

Experimentally I tried to rewrite the first of these as a Primary partition, but TestDisk came back with a "Write error", indicating that it's still seeing the device as write protected.

I remain confused why Windows and TestDisk are still seeing this drive as write-protected when I've been able to save small text files on it from Linux. I think it must be something to do with boot sector incompatibilities, and I'd like to know how to write a completely new boot sector on this device which will be recognised by both Linux and Windows and which will clear the write protection I'm still seeing when I use Windows. Earlier this year I checked regedit HKEY_LOCAL_MACHINE\System\CurrentControlSet/control\StorageDevicePolicies and verified writeprotect was set to 0.

Thanks for bearing with this long story, which is only about one of my three failed devices. Maybe I'll work on the other two and post again later.
 

tortis97

Reputable
May 8, 2014
1
0
4,510


I have the exact same problem, but i don't know what to do exactly with the commands you gave. Can you please give me more detailed directions. I assume from the use of sudo that this must be done from linux?
 

SleepyzzJohn

Honorable
Dec 6, 2013
18
0
10,510
Hello tortis97. If you read through my April 30 saga right to the end, you will see that awilkins suggestions haven't actually worked for me, although it did appear at first that they were doing so. I'm afraid that you could go to a lot of trouble setting up and learning about a linux system only to find like me that the string of zeros awilkins' command writes on your flash drive doesn't fix it in the end.

Do you already have access to a linux system, or are you thinking of downloading one and burning a live CD ? If you can explain exactly where you are down this road just now, maybe I could guide you to the next step.

Right now, I've placed the problem of my three different flashes becoming unusable on hold pending a refill of personal time and motivation. I wish I could offer you a good working solution, but at the moment I'm sorry I can't.
 

Roger Dahl

Reputable
Jun 2, 2014
2
0
4,510
Not a solution, just some thoughts...

USB flash drives use the USB mass storage device class (http://en.wikipedia.org/wiki/USB_mass-storage_device_class). This is a higher level protocol than raw device access. Apparently, the standard allows for a number of different protocols but in practice, USB flash drives only use SCSI commands and support a subset of the commands in the list at http://en.wikipedia.org/wiki/SCSI_command.

So, the host does not "directly" access the flash memory but sends SCSI commands requesting operations to be performed. How the flash drive responds to those commands depends on its firmware. I think the host checks if the device is read-only by issuing a MODE SENSE SCSI command and checking if the device returns a MODE_DSP_WRITE_PROTECT bit.

So it seems like the question is, what causes the SCSI controller in the flash drive to determine that the flash drive has been write protected. If the controller reads that information from a private storage area in flash, then that information must have been set either in response to an actual SCSI command to write protect the drive, or by a bug in the controller allowing you to overwrite the private information with user data. If it's the first, then it should be possible to send another SCSI command to unprotect the drive and if it's the latter, then the bug has basically locked you out of the drive. Then, I think the only solution would be if the controller has some "back door" through which lower level commands can be issued, maybe through a utility made by the manufacturer, to update the contents of the private storage.
 

SleepyzzJohn

Honorable
Dec 6, 2013
18
0
10,510
Roger Dahl wrote: Not a solution, just some thoughts...

Hmmm...no, not an answer, but worth thinking about nevertheless, so thanks for your welcome post.

Meanwhile, I've had two more drives go write-protected on me, making a total of four so far. I originally attributed the cause to be somehow associated with my having "burned" them as bootable from an .iso, which is what I did with the first two, but that theory is now losing credibility since the other two have gone write-protected more recently without any .iso or "burning". Four is just too many to attribute to bad luck, so I feel there has to be some other common factor, but I still don't know what!!

My 4th one to go write-protected (a Kingston 8GB data traveller) has actually responded OK to formatting treatment with mUSB Fixer and I've got it back and working again, but no such luck with my other three.

So like Roger Dahl, I don't have a solution, but thought it worth sharing my latest experiences in case they spark any new ideas with the readers here. Any other success or failure stories, anyone?

 
Status
Not open for further replies.