LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   FAT filesystem - bad superblock (https://www.linuxquestions.org/questions/linux-hardware-18/fat-filesystem-bad-superblock-4175461386/)

ivanatora 05-10-2013 12:47 AM

FAT filesystem - bad superblock
 
Hello,
Last night my android phone said it can't read the SD card and it wanted to format it. I pulled it out, put it in a card reader and tried to mount it on my desktop pc:

Code:

$ sudo mount /dev/sdb1 tmp
[sudo] password for ivan:
mount: /dev/sdb1: can't read superblock

Tried to fsck it:

Code:

$ sudo fsck.msdos /dev/sdb1
dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
/
  Contains a free cluster (2). Assuming EOF.
FAT32 root dir starts with a bad cluster!

And to see if there is actualy anything to mount:

Code:

$ sudo fdisk -l /dev/sdb

Disk /dev/sdb: 3951 MB, 3951034368 bytes
122 heads, 57 sectors/track, 1109 cylinders, total 7716864 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
Disk identifier: 0x00000000

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1            8192    7716863    3854336    b  W95 FAT32

Now I'm doing a dd image before I've broken something else.

I know EXT filesystems have superblock backups across the device that can be used in such a moment. Does FAT have backups?

Do you know any method for recovery?

I've tried photorec and it did manage to retrieve data, but without any file names or directory structure. It doesn't do any good except to restore my pictures, and they are my least concern.

[UPDATE] dd failed with Input/output error after copying 2.7 GB. Is it possible the card is really broken?

pan64 05-10-2013 12:54 AM

usually FAT has a backup too. you can try testdisk to fix your SD card.

ivanatora 05-10-2013 01:02 AM

Do you mean photorec? I've installed it from a packet named 'testdisk'. I've already tried it, but with a very limited success.

[EDIT]
Ah, testdisk is different! And it did the job!
Here is what I did:
sudo testdisk

>Create a new log file
[Choose Disk]
>Intel/PC partition
>Advanced
[Choose Partition]
>Boot
>Repair FAT
[Accept Defaults and Write]
>(Q)uit until exited

From here: http://ubuntuforums.org/showthread.php?t=2103994

pan64 05-10-2013 01:46 AM

I mean this: http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step


All times are GMT -5. The time now is 04:39 PM.