FAT filesystem - bad superblock

11

2

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:

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

Tried to fsck it:

$ 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:

$ 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.

Ivan Petrushev

Posted 2013-05-10T05:53:32.427

Reputation: 1 591

Actually dd failed with Input/output error after copying 2.7 GB... Is it possible that the card hardware is damaged in some way? – Ivan Petrushev – 2013-05-10T05:56:00.530

If dd fails it is in 99.999% of the cases a hardware failure. – Bobby – 2013-05-10T06:54:24.387

Answers

18

testdisk did the job!

>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

Ivan Petrushev

Posted 2013-05-10T05:53:32.427

Reputation: 1 591

Saved 80GBs of my data! – Vishnu Mohan G – 2016-03-10T19:24:37.470

This did the job. But testdisk says it's very dangerous though. I had tried writing partition first, but it didn't work. – Thu Yein Tun – 2016-03-27T06:51:03.060

3

This was a life saver, thanks! Two things:

  1. In my case, I had to choose "Rebuild BS" before the "Repair FAT" action was open to me. As a comment in the forum thread you linked points out, more info on that (and TestDisk generally) is here: http://www.cgsecurity.org/wiki/Advanced_FAT_Repair#Rebuild_a_valid_FAT_boot_sector

  2. You should accept your own answer, I believe that's the protocol. Hopefully it helps people turn up this solution, because it's a common problem!

– Michael – 2013-11-17T03:47:55.450

I'm glad it did a thing for someone. Yeah, probably you are right - accepted the answer. – Ivan Petrushev – 2013-11-17T12:00:32.823

1This worked for me however I experienced partial data loss. Thanks. – Substantial – 2013-12-27T03:00:27.503

0

My problem was today an usb-HDD-FAT32-Partition G: with "can't read superblock" in Windows XP and OpenSuse 12.3. The solution was: Windows XP Command cmd chkdsk G: /F /R

Wolfgang

Wolfgang Lange

Posted 2013-05-10T05:53:32.427

Reputation: 1