I have an external drive. I had transfered some files/directories to it on another computer. I fired it up today, and I was getting input/output error on one directory on doing "ls -l".
I was not being able to cd into that directory (but the directory was being listed in "ls")
Fat 32 partition.
I did
fsck.vfat -a -v /dev/sdc5
It ran for some time, now I can cd into that directory, but it does not have any data.
Instead the parent directory has a bunch of "FSCK0008.REC" type files.
Whats going on, and how do I fix it ?
-
wearetheborg Notebook Virtuoso
-
Your FAT filesystem got corrupted. When you ran fsck, the files .REC files that it created are most likely to be lost clusters (i.e. partial fragments of files), the .REC should all be the same size and multiples of 1024 bytes.
Because you have already run a disk repair tool (in this case fsck) there is not a lot more you can do, the repair has already been performed to the best that it can do (you've missed the opportunity to use a different repair tool unless you saved an image of the corrupted disk and can start again). -
wearetheborg Notebook Virtuoso
Should I have attempted the repair in windows XP ?
The directory in question had (mostly) zip files.
I copied over one .REC file and renamed it to .zip, and was able to extract it ok.
"less xyz.REC" seems to display the files in the original archive for most of the .REC files, so most of the data seems ok.
Actually I dont really care about this particular lost directory, but if it had been something else I would have been like "NO NO NOOOOO".
How does one use .REC files in general ?
For instance, my FSCK0000.REC file shows up as around 6MB, yet when I do less FSCK0000.REC I get:
Archive: ./FSCK0000.REC
FSCK0000.REC lines 1-1/1 (END) -
There are better tools to recover FAT filesystems under windows (but I am not up to date on which tools are recommended, though I doubt the ones included by M$ are as good as the third party tools).
The important thing to be aware of is that filesystem corruption will invariably result in data loss, even journalled filesystems (e.g. ext3 or reiserfs) do not protect against data loss they usually strive to leave your filesystem in a valid state which isn't necessarily the most recent saved state for all your files.
Recovering from filessytem corruption is a hit and miss affair, in this case the *.REC files are fsck.vfat tools way of converting lost cluster chains into files (quite probably partial files). The method used to create the .REC files is just an informed guess.
What you do with those .REC files, is you examine them as you have been doing, rename any back to sensible names if they are complete files (such as the ZIP file you talked about), and for partial files attempt to salvage anything useful e.g. text that they contain. It is usually a manual process, except where specialist tools have been written such as scanning disk sectors for photographs usual jpeg files on flash disks (CF, SD...). Commercial data recovery specialist can charge lots of money to recover data!
There is also a linux command called 'file' which examines the beginning of a file and tries to guess what type of file it is, but it doesn't check that the file is complete.
Bottom line is you should be performing backups of your valuable data, and not relying on data recovery tools, hard drive can and do fail.
You can also consider RAID disks, but I don't know much about those and I am sure you should still perform backups even of those.
Oh, and because of the size of hard disks, performing backups is PITA
I ran fsck.vfat to repair hard drive, and got a bunch of .REC files !
Discussion in 'Linux Compatibility and Software' started by wearetheborg, Jan 2, 2007.