0

I see lots of questions about recovering data from corrupted SD card formatted as internal storage, that's not my case. I want to FORMAT this SD card to be able to use elsewhere.

For some reasons the card become read-only so it is impossible for me to make any changes. While on the phone I tried to switch the card from internal memory to external. It didn't work. The only option I had was to forget the card, and so I did. Now even with gparted on linux, I'm not able to format the card. I tried also to change the permits with

sudo chmod -R 777 /dev/sdb

and other different commands like

sudo mount -o remount,rw /dev/sdb

all without luck.

What else can I do? It seems impossible to reset this card.

Ps. the lock on the SD adapter is in the correct position

edit1: I've used sudo badblocks -wsv /dev/sdb no errors found, but not luck, the partitions are still there (here how to use badblocks https://wiki.archlinux.org/index.php/badblocks). The process took around 10 hours for a 64Gb card.

edit2: after asking help to bunsenlabs.org these things came out. At the moment I can't try them because I don't have the hardware required but my gut and my common sense tell me that it's the right path.

links:
https://github.com/Nephiel/sdlocker-tiny
https://github.com/BertoldVdb/sdtool

overkill22
  • 101
  • 1
  • 3

2 Answers2

1

It sounds like the other answer of the FAT being corrupt is likely, I would try "zeroing out" the card...

First, verify the device. It will be something like /dev/sdX or similar, make absolutely sure you know this device is correct. Then, in Linux open terminal and enter the following command:

$ sudo dd if=/dev/zero of=/dev/sdX bs=8192

Substituting the correct device name for /dev/sdX.

DO NOT interrupt this process or it could possibly brick the SD card.

Once it has completed, eject and remove the card. Wait a few seconds then reinsert the card in the card reader. After this, open gparted (or your partition manager of choice) and create a new FAT and partition. In gparted, this is accomplished by selecting Device, then Create Partition Table from the toolbar menu, I would recommend using msdos as the partition type. Then after that process completes, select Partition - New, and change the File System to fat32 (or whatever is appropriate for your card) and click Add. Then Apply (the "return" arrow in the menu bar).

Once this has been completed, remove the card and reinsert it, it should be readable in Linux, Windows, and most other operating systems.

acejavelin
  • 6,197
  • 2
  • 19
  • 32
  • I followed the step but like last time, it didn't work. The dd process finish, but gparted still see the two partitions. If I format with msdos the process end with no errors, but then the sd card refresh with the same old partitions. Trying to do different operations or using different file systems doesn't change anything. – overkill22 Jun 12 '18 at 21:49
  • I don't know what to do anymore if even dd is not working. – overkill22 Jun 12 '18 at 21:57
  • @Alessio We have definitely seen corruption of adopted storage nuke a card... I guess becoming permenantly read only is a possibility as well. – acejavelin Jun 12 '18 at 21:59
  • how can a card become permanently read only??? The card is working perfectly as I could backup all my stuff and etc, it's just I can't do anything now because it's in read only mode. There must be something to do. – overkill22 Jun 12 '18 at 22:05
  • @Alessio I don't know, but I had a USB thumb drive do it once... I wound up breaking it and throwing it away because I could not get the data erased. – acejavelin Jun 13 '18 at 03:10
  • this is what happened at my last sd card. I refuse to do the same on this 64Gb card bought only one month ago. How can be a software restriction so unbreakable? – overkill22 Jun 13 '18 at 07:57
  • @Alessio if it's only a month old, why not get a warranty replacement? Most manufacturers have at least a year warranty – acejavelin Jun 13 '18 at 11:17
  • Sandisk has a lifetime warranty and they replace the item really fast. But this is not the point. The card was locked from Android and it is impossible to unlock back, unless using one of the links I posted on edit2. – overkill22 Jun 13 '18 at 15:32
  • @Alessio "Every card has two programmable flags, one for temporary write protection and one to lock the card forever." - https://github.com/BertoldVdb/sdtool Might want to review this, if this portion of the card gets corrupt/damaged in the right place, BAM, it is read only forever. EDIT: Nevermind, I see you found that too. – acejavelin Jun 13 '18 at 18:52
  • yes, found and it is really interesting. Didn't know that. But what if it is not damaged but I can't change the permit bcs don't have the tool? There must be a way to be able to modify /dev/sdb instead of only /dev/mmcblk. – overkill22 Jun 14 '18 at 15:43
  • @Alessio Possibly, but to be honest the nitty gritty of that is over my head. – acejavelin Jun 14 '18 at 15:44
0

That sounds as if the FAT might have some kind of error. The card automatically gets mounted read-only, and no matter how many times you go into settings and try to unmount/remount the card, it is to no avail.

In Windows, you can just insert the card into PC, right click on its Properties/Tools/Check and check it against possible errors and automatically fix them. Or you can also use any file system checking tool of your choice.

MGLabs
  • 59
  • 4
  • didn't work. before checking for errors is asking to format the card. formatting the card is not possible because of some errors. – overkill22 Jun 12 '18 at 21:57