0

I know this is a duplicate question, maybe triple duplicate or more, but I really cannot find a solution for this. My USB Drive wasn't write protected before, but something happened to it and now I cannot write to or format it.

I have tried in ubuntu to change the permissions, fsck, fdisk, dmesg | tail, mkfs -t vfat, hdparm -r0 and nothing works; all I get is Permission Denied. I tried from GParted but it also says it's read only. I have also tried using Windows to change permissions, setting attributes disk clear readonly, renaming the key in the registry, and tried a low level format.

But truly nothing works. Also, the stick doesn't have any hardware pin or switch for write protection.

Is there any solution to this or should I just give up?

6
  • Take a look and "Bear in mind that there is no guarantee that they will work for you: your USB flash drive or SD card may be corrupt or physically broken and no utility or low-level formatting tool will make it work again. The only solution in this case is to buy a new drive.": pcadvisor.co.uk/how-to/storage/… Commented Jan 6, 2017 at 11:02
  • Thanks for the answer. I have already checked that and didn't helped me. I know, otherwise if guarantee was valid for me i would never give back a USB with my personal data just to replace it. I really wonder though why that happened, because it wasn't physically broken or something. For real it just happened, that's why i supposed it can be solved. But i really doubt now.
    – akris
    Commented Jan 6, 2017 at 11:26
  • The solution is always the same. Get any data you need/can from it, then bin it or smash it & use another one.
    – Tetsujin
    Commented Jan 6, 2017 at 12:12
  • Unfortunately yes, the USB is useless now. But i still cannot understand how there is not away to fix that. At first i thought it would be just a chmod issue or something and not that big.
    – akris
    Commented Jan 6, 2017 at 12:21
  • What is the maker of your "a USB Drive" ? Commented Jan 6, 2017 at 19:18

1 Answer 1

1

The canonical answer is already given - get data out and trash the stick.

USB Mass Storage class of devices uses a subset of SCSI commands to operate flash drives above USB physical layer. There is REQUEST SENSE command (see Section 5), which returns a bunch of status data, including code "07" - WRITE PROTECTED MEDIA. All this bits are set inside the USB-to-flash bridge chip, by chip's embedded firmware. If the firmware has decided (as SanDisk once explained) to set this bit "for protection of possible user data corruption", there is no way to "unset this bit", at least people didn't find any way to circumvent the firmware.

Formally, this WRITE PROTECTED MEDIA bit is just to inform the host that it should not attempt to write to this media. If a host driver gets the WP status from media, it will not attempt to write. To circumvent this, the host driver must be hacked. Some media controllers might accept and execute the write command even if the bit is set. But apparently there are controllers IP that are overly protective, and will refuse even this hack on host side if their firmware logic has come to a conclusion that the media exhausted its reliability thresholds.

8
  • Ali - you ought to add that info to bwDraco's community answer on the linked question. I already knew the gist of it but not the detail. It's canonical enough to stand as part of that answer, imho.
    – Tetsujin
    Commented Jan 7, 2017 at 11:32
  • I have read about that and i understand why that happens and what causes it. But for me it looks so bad that you cannot fix that, not only from the waste of money aspect. It looks like an if without an else.
    – akris
    Commented Jan 7, 2017 at 16:15
  • @D1m, thanks for mentioning that the flash is made by SanDisk. This correlates with other cases. Actually, I don't understand why it happens. It shouldn't happen in such short time span, or under any unlucky detachment/attachment. I think SanDisk has an ugly bug in their chips. Commented Jan 7, 2017 at 16:22
  • The USB is brand new i only have 2 weeks and the problem appeared at the first week. The irony is that i have bought SanDisk USBs at the past and had good experience, that's why i bought another one. For sure it was the last one. As i have read on my search i saw too that SanDisk faces that problem at their USB not so rarely.
    – akris
    Commented Jan 7, 2017 at 16:24
  • @Tetsujin, I have a disagreement with bwDraco on this matter. He believes that this "read-only" or dead flash drive issue is a result of some general system hick-up that is common to all USB flash media, while I believe that this is a problem with some particular hardware/firmware employed by certain manufacturers. See my comments there, and his reaction. Commented Jan 7, 2017 at 17:35

Not the answer you're looking for? Browse other questions tagged .