Subscribe to RSS feed

splitbrain.org - electronic brain surgery since 2001

Recovering JPGs from a Corrupted VFAT FS

Friends o' me mum came back home from their vacation recently. They where eager t' see all th' digital photos they took. Only t' discover that their computer couldn't read th' SD card anymore.

Of course this means that this card appeared on me desk in no time :-).

Rescued Wooden Figurines

Put into me card reader and checkin' dmesg showed th' card t' be at least “electrically” alive:

sd 3:0:0:2: [sde] 1950720 512-byte hardware sectors (999 MB)
sd 3:0:0:2: [sde] Write Protect is off
sd 3:0:0:2: [sde] Mode Sense: 03 00 00 00
sd 3:0:0:2: [sde] Assuming drive cache: write through
sd 3:0:0:2: [sde] 1950720 512-byte hardware sectors (999 MB)
sd 3:0:0:2: [sde] Write Protect is off
sd 3:0:0:2: [sde] Mode Sense: 03 00 00 00
sd 3:0:0:2: [sde] Assuming drive cache: write through
 sde: unknown partition table

But tryin' t' mount it failed:

$ sudo mount -t vfat /dev/sde /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sde,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

dmesg told me:

FAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev sde.

Bad. First thin' t' do is t' make a backup:

$ sudo dd if=/dev/sde of=sdcard.img bs=1M

My next attempt were bein' t' repair th' file system usin' fsck.vfat, but this failed.

$ sudo fsck.vfat -v /dev/sde
dosfsck 2.11 (12 Mar 2005)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Logical sector size is zero.

Rescued Cuckoo Clocks

I then googled aroun' fer some tips how t' manually recover a VFAT system. Shiver me timbers! The best descriptions where in this forum thread, but like th' OP there, I came t' now result.

My next thought were bein', that I exactly knew what data there were bein' t' recover: JPEG files. JPEGs should be easy t' recognize based on their headers.

Of course I weren't th' first with this problem. And I weren't th' first with th' solution notion. Googlin' a bit more finally brought me t' a blog post by Mark Lynch.

Rescued Jesus

The solution is called recoverjpeg. After 10 minutes o' downloadin', compilin' and runnin' it on th' backup image, me reputation as th' “computer lubber that can fix these thin's” were bein' secured:

$ recoverjpeg sdcard.img 
Restored 620 pictures

PS: all pictures stolen recovered from th' card ;-)

Tags:
linux, vfat, jpeg, recovery
Similar posts:
Posted on Wednesday, October the 15th 2008 (6 years ago).

Comments?

blog comments powered by Disqus