0

I have a SanDisk 32 GB microsd card that i have been using for my smartphone. A few days ago the sd card crashed and i cannot access any files on my card.

I tried using testdisk utility as i did rescue my data earlier using it for my pendrive, but testdisk could not access any partition.

Then i tried using fdisk and deleting the partition and creating a new one:

Disk /dev/sdb: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 5CB171C8-5A20-4253-9A15-61DF908359A5

Device     Start      End  Sectors  Size Type
/dev/sdb1   2048    34815    32768   16M unknown
/dev/sdb2  34816 62333918 62299103 29.7G unknown
d
Partition number (1,2, default 2): 1

Partition 1 has been deleted.

Command (m for help): d
Selected partition 2
Partition 2 has been deleted.
Command (m for help): n
Partition number (1-128, default 1): 1    
First sector (34-62333918, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-62333918, default 62333918): 
Created a new partition 1 of type 'Linux filesystem' and of size 29.7 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Now this should have created a partition and saved it into the partition table but now when i am running fdisk again and looking at the partition table the sd card still has two partitions of unknown type.

Device     Start      End  Sectors  Size Type
/dev/sdb1   2048    34815    32768   16M unknown
/dev/sdb2  34816 62333918 62299103 29.7G unknown

I tried doing the same thing using gparted, formatted the partition to NTFS or Fat file format, it ran the complete process and showed the successful message, but it is back to the same thing again.

Something is stopping me to write on my sd card, as if its read only, so i tried the solution that i found on the internet:

sudo hdparm -r0 /dev/sdb
/dev/sdb:
 setting readonly to 0 (off)
 readonly      =  0 (off)

Now when I am repeating all the steps it is not making any difference. I would like to know what is going on. I don't care about the data now, as you must have realized, I just want to know if I can use the card again.

This is very interesting actually too, what could have occured inside the card to render it read only?

8
  • 1
    Maybe your card is 'gridlocked', which is the first stage of failing. But there might be another problem, so I suggest that you try a few different methods. If they all fail, you can conclude that the card is damaged beyond repair. See this link and links from it, askubuntu.com/questions/894095/…
    – sudodus
    Apr 4, 2017 at 4:41
  • I have tried most of these steps, but i will try them again and let you know.
    – Ati
    Apr 5, 2017 at 12:00
  • Error: You requested a partition from 1049kB to 31.9GB (sectors 2048..62333951). The closest location we can manage is 1048kB to 1048kB (sectors 2047..2047). mkfs.fat 3.0.28 (2015-05-16) WARNING: Not enough clusters for a 32 bit FAT! That's the message it shows while in mkusb. But after that it shows this:
    – Ati
    Apr 5, 2017 at 12:32
  • hidden sectors 0x0800; logical sector size is 512, using 0xf8 media descriptor, with 32768 sectors; drive number 0x80; filesystem has 2 32-bit FATs and 1 sector per cluster. FAT size is 252 sectors, and provides 32232 clusters. There are 32 reserved sectors. Volume ID is 1e8d4392, volume label SD . Done :-)
    – Ati
    Apr 5, 2017 at 12:33
  • But Still no success
    – Ati
    Apr 5, 2017 at 12:33

1 Answer 1

0

Did you enable the lock switch on the edge of the sd card? That would set it to readonly on a hardware basis.

1
  • I am working on a micro sd card, so it does not have that lock switch, but yes the reader does have a lock switch and i am sure its not locked. I even repeated the steps with the switch in both positions to make sure that the card is not locked.
    – Ati
    Apr 5, 2017 at 11:58

You must log in to answer this question.

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