DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 5th January 2010
algkalv's Avatar
algkalv algkalv is offline
New User
 
Join Date: May 2008
Location: Oslo, Norway
Posts: 7
Default Corrupted msdos filesystem on a compactflash card - recovery

Hei,

One of my CompactFlash cards has a corrupted filesystem, and I wonder if I can do anything about it to recover some of the photos I still have there.

I have tried to run fsck_msdosfs, and the result is this:

Code:
$ fsck_msdosfs -py /dev/da0s1
** /dev/da0s1
** Phase 1 - Read and Compare FATs
** Phase 2 - Check Cluster Chains
** Phase 3 - Checking Directories
** Phase 4 - Checking for Lost Files
297 files, 1152256 free (36008 clusters)

$ fsck_msdosfs -y /dev/da0
** /dev/da0
Invalid sector size: 20487
The dcim/101msdcf appears as a file, whereas it's normally a directory with jpeg files in it. Post mount:

Code:
$ file dcim/101msdcf 
dcim/101msdcf: ERROR: cannot read `dcim/101msdcf' (Argument list too long)
Do you have any hints as to what I could do to recover the files?
Reply With Quote
  #2   (View Single Post)  
Old 5th January 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

There are a couple utilities that will scan over a medium and can recover common image/document formats, although if any of the files are fragmented it might not be able to recover them properly.

FreeBSD has the sysutils/testdisk port available, photorec which is also included.. may be helpful.

I'm not sure of the details of the FAT file system, but you probably should have left it as-is.. make an image of it, don't mount it read/write.. it's possible that you lost all of those images.

You cannot recover overwritten files, just "misplaced" ones.
Reply With Quote
  #3   (View Single Post)  
Old 5th January 2010
algkalv's Avatar
algkalv algkalv is offline
New User
 
Join Date: May 2008
Location: Oslo, Norway
Posts: 7
Default

testdisk complains about geometry. I have tried (as suggested) 16,32,64,128,240,255 heads per cylinder, and none of these results in anything useful; it still complains about "bad ending head".

With the following values (256 cylinders, 255 heads, 63 sectors per track, 512 sector size), what I see is this:

http://img177.imageshack.us/img177/3646/headsf.png

http://img177.imageshack.us/img177/3830/heads2.png

http://img177.imageshack.us/img177/1032/dirx.png

http://img177.imageshack.us/img177/4308/dir2.png

Are there any other values of heads I should try, and if not, what else remains to do? I have created the image.dd file so far.
Reply With Quote
  #4   (View Single Post)  
Old 6th January 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

You should use photorec, which as I said.. is included with testdisk.
Reply With Quote
  #5   (View Single Post)  
Old 6th January 2010
algkalv's Avatar
algkalv algkalv is offline
New User
 
Join Date: May 2008
Location: Oslo, Norway
Posts: 7
Default

Thank you kindly, sir. Apart from a few damaged files, I recovered just about everything.

May leaves always rustle under your feet.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disaster recovery best practices RandomSF FreeBSD General 8 7th December 2010 06:41 AM
Recovery CVsup files vigol FreeBSD Ports and Packages 1 5th December 2009 10:38 PM
data recovery. LateNiteTV FreeBSD General 8 29th August 2008 08:11 PM
dvd filesystem type chill FreeBSD General 6 17th June 2008 08:22 AM
Best Filesystem thavinci FreeBSD General 25 29th May 2008 03:32 PM


All times are GMT. The time now is 02:04 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick