SLUG Mailing List Archives
Re: [SLUG] Recovering photos from an XD card
- To: James Sadler <freshtonic@xxxxxxxxx>
- Subject: Re: [SLUG] Recovering photos from an XD card
- From: Peter Chubb <peterc@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Apr 2009 20:58:28 +1000
- Cc: slug@xxxxxxxxxxx
- Organization: Gelato@UNSW
- User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/22.2 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI)
>>>>> "James" == James Sadler <freshtonic@xxxxxxxxx> writes:
James> Hi all, I stupidly removed an XD card from my card reader under
James> Linux without unmounting it first. When I put the card back in
James> the machine, most of the pictures were missing. I'm guessing
James> the filesystem is corrupt. In theory the photos themselves are
James> still there. Does anyone know how I could restore these under
James> linux? I am running Ubuntu Jaunty.
Hmmm. Were you copying files *to* the card? If so they may never have
got there (they'll still have been in Linux's filesystem cache).
If you know the filenames fsck.vfat can recover the files.
As always, first make a complete image copy of the filesystem in case
dd if=/dev/sdc1 of=/var/tmp/image bs=1M
(/dev/sdc1 is the damaged partition, could be something else).
Use strings to find file names:
Choose the ones to undelete, then
fsck.vfat -rv -u /name/of/file/to/recover.jpg /var/tmp/image
(I've never tried to undelete more than one file at a time, but check
Then mount it with
mount -oloop /var/tmp/image /mnt
and copy the files off:
cp /mnt/name/of/file/to/recover.jpg /tmp
If this all doesn't work, the XD card's image is still intact for
another go with different method.
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
http://www.ertos.nicta.com.au ERTOS within National ICT Australia
A university is a non-profit organisation only in the sense that it
spends everything it gets ... Luca Turin.