[Gloucs] dosfsck to the rescue!
Paul Broadhead
lug at twinmoons.clara.co.uk
Wed Dec 10 02:02:38 GMT 2003
Hi all,
More in my continuing list of software tragedies: I have a bash script
that copies images from my digital camera to my PC. It has an option to
delete the images from the camera after verifying the copy is OK. I
never normally use this option and instead wait until I need to free the
space.
Anyway, on Sunday we went out for a walk and we took some snaps. Back
home, I copied them off the camera, strangely using the delete function
this time. Then while deleting the bad ones off my hard disk, I managed
to delete all the ones I wanted too. Puff, all gone. I was a bit
annoyed with myself. You can imagine! Just don't ask about the gory
details....
Linux deletes are notoriously final. I did a bit of googling and it all
looked hopeless. Then I remembered that the camera uses a FAT
filesystem. It's much easier to undelete files from FAT, much easier to
loose files too for that matter. Thinking this would be a windows thing
I went to the kids games machine, downloaded some undelete shareware and
attached the camera. No can do sorry, windows USB treats the camera
filesystem as something special so would not even contemplate undeleting
the files.
As a final attempt, I had a look for Linux based tools. Eureka! I
eventually found dosfsck, part of the dosfstools package. This can fix
corrupted FAT files systems and undelete files too. I installed
dosfstools, "apt-get install dosfstools", mounted the camera "mount
/mnt/camera", ran a few dosfsck commands "dosfsck -r -u
/dcim/100olymp/pc070001.jpg /dev/sda1" etc, and hey presto, I had my files
back. I was very happy and thankful, once again, that I'm a Linux user.
I must email the dosfstools authors and thank them too!
Regards,
Paul
More information about the gloucs
mailing list