LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-02-2007, 04:33 PM   #1
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 17
Posts: 278

Rep: Reputation: 41
I ran fsck.vfat to repair hard drive, and got a bunch of .REC files !


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 ?
 
Old 01-02-2007, 05:28 PM   #2
jonnycando
Member
 
Registered: Nov 2006
Location: Virginia
Distribution: OpenSuSE 10.2
Posts: 121

Rep: Reputation: 15
Unhappy

Quote:
Originally Posted by wearetheborg
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 ?
Those rec's are the data the fsck recovered. If you open them you might recognize some of it. But parsing it all and saving what you find would be a nightmare. Figure your data as toast unless you really want to scroll through each file line by line to identify your stuff. Some of it is probably binary and I don't know how you would separate that to make new files. But as far as fixing, your filesystem is fixed, and your data is well....."fixed"
 
Old 01-02-2007, 05:43 PM   #3
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 17
Posts: 278

Original Poster
Rep: Reputation: 41
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)
 
Old 01-02-2007, 06:56 PM   #4
anupamsr
Member
 
Registered: Sep 2004
Location: India
Distribution: Kubuntu, Archlinux, Suse, Gentoo, Mandrake
Posts: 370

Rep: Reputation: 30
Quote:
Should I have attempted the repair in windows XP ?
If you would have done the same using Windows XP, you would have gotten the same results with some other file names (I don't remember right now, FILE0001.chk or something like that).

Last edited by anupamsr; 01-02-2007 at 08:16 PM.
 
Old 01-02-2007, 08:08 PM   #5
jonnycando
Member
 
Registered: Nov 2006
Location: Virginia
Distribution: OpenSuSE 10.2
Posts: 121

Rep: Reputation: 15
Quote:
Originally Posted by anupamsr
If you would have done the same using Windows XP, you would have gotten the same results with some other file names (I don't remember right now, FILE0001.chk or something like that.
Yes indeed...such outputs are what is collected from lost clusters or blocks. (Clusters which have lost their affiliation with the directory tree) The fixit program such as fsck in Linux, or chkdsk/Scandisk in DOS and Windows gathers them all and builds them into files of a certain maximum size. Since you knew that all or most of your files were zips, your odds of getting them back by just renaming them are good. But there may be some overlap, that is the rec files you have may contain a bit of one zip file, and a bit of another. renaming and examining will tell you for sure, but it looks good for getting at least some of it back in useable condition. If the directory tree was really trashed, I don't think Scandisk or chkdsk could have fixed things any better.
 
Old 01-02-2007, 09:38 PM   #6
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 17
Posts: 278

Original Poster
Rep: Reputation: 41
On a related note, do you guys know how convert a bunch of "xyz.REC" files to "xyz.zip" by some script ? Its going to be painful renaming 100+files manually.

Also, why is "less FSCK0000.REC" just giving me one liine, when the file is of 6+MB ?

Finally, here is another problem.
The coorupted directory was "foo" in parent folder.
I have the .REC files in the parent folder.
The .REC files consist of data that was originally in the directory foo.
On doing
"mv *.REC foo/." I get the error message (for all the files:
mv: cannot move `FSCK0083.REC' to a subdirectory of itself, `foo/./FSCK0083.REC'

Whats going on ?

Last edited by wearetheborg; 01-02-2007 at 10:47 PM.
 
Old 01-02-2007, 10:15 PM   #7
jonnycando
Member
 
Registered: Nov 2006
Location: Virginia
Distribution: OpenSuSE 10.2
Posts: 121

Rep: Reputation: 15
Quote:
Originally Posted by wearetheborg
On a related note, do you guys know how convert a bunch of "xyz.REC" files to "xyz.zip" by some script ? Its going to be painful renaming 100+files manually.

Also, why is "less FSCK0000.REC" just giving me one liine, when the file is of 6+MB ?

Finally, here is another problem.
The coorupted directory was "foo" in parent folder.
I have the .REC files in the parent folder.
On doing
"mv *.REC foo/." I get the error message (for all the files:
mv: cannot move `FSCK0083.REC' to a subdirectory of itself, `foo/./FSCK0083.REC'

Whats going on ?
0083.rec may BE a directory! Try to cd to it and see what happens....it may be the tattered remains of your original /foo! As for less, I think it just gives you a peek? Don't quote me there, I use it but rarely. As for the script.....why not? But how to do shell scripts I know not how just yet....but there was a day when I could deftly do one in BASIC! In DOS you would do something like [ren *.rec *.zip] and that would accomplish it.

Last edited by jonnycando; 01-02-2007 at 10:20 PM.
 
Old 01-02-2007, 10:46 PM   #8
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 17
Posts: 278

Original Poster
Rep: Reputation: 41
Its not with just 0083.REC, I'm getting the error message with all the files.
On doing cd:
$cd FSCK0083.REC
bash: cd: FSCK0083.REC: Not a directory

The .REC files consist of data that was originally in the directory foo.
 
Old 01-03-2007, 06:35 AM   #9
jonnycando
Member
 
Registered: Nov 2006
Location: Virginia
Distribution: OpenSuSE 10.2
Posts: 121

Rep: Reputation: 15
AH wait...it may be your syntax...........perhaps mv *.rec /foo, instead of foo/ I think.
 
Old 01-03-2007, 02:07 PM   #10
anupamsr
Member
 
Registered: Sep 2004
Location: India
Distribution: Kubuntu, Archlinux, Suse, Gentoo, Mandrake
Posts: 370

Rep: Reputation: 30
This may come handy:

$ file FSCK0083.REC

It will tell you if the FSCK0083.REC is directory or a zip file.
 
Old 01-03-2007, 02:11 PM   #11
anupamsr
Member
 
Registered: Sep 2004
Location: India
Distribution: Kubuntu, Archlinux, Suse, Gentoo, Mandrake
Posts: 370

Rep: Reputation: 30
less FSCK0000.REC will may show you one line because that one is tooooo long? Open the same file in some editor and do 'wrap'. You will see for yourself. The other possibility is that the file consists of spaces?

To rename, just do this:
$ rename REC zip *

though move command can also be used

(NOTE: There are several versions of rename roaming around, so may be this command will not work)
 
Old 04-14-2007, 06:52 AM   #12
zlatan24
LQ Newbie
 
Registered: Apr 2007
Posts: 3

Rep: Reputation: 0
If you have damaged zip files. Then see below!
 
Old 04-14-2007, 06:54 AM   #13
zlatan24
LQ Newbie
 
Registered: Apr 2007
Posts: 3

Rep: Reputation: 0
Try zip_fix. It program may recover corrupted zip archives(files) from HDD, CD, DVD and other devices.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Repair Hard drive bad sector jselby Linux - Hardware 4 10-25-2005 07:27 PM
Can't get X to come up after I ran FSCK zLinuxz Linux - General 3 08-10-2005 04:51 PM
fsck and lost hard drive space LinuxGeek Linux - Software 1 07-19-2005 09:17 PM
fsck won't repair drive ffib Linux - General 5 10-06-2003 03:42 PM
Linux Software to Repair Hard Drive adamsjw2 Linux - Software 4 08-06-2003 06:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration