The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
*** glibc detected *** double free or corruption: 0x40236ff4 *** norsk hedensk High Level Programming 19 2 Weeks Ago 10:43 AM
ftp zip files corruption colesga Shell Programming and Scripting 3 08-02-2007 08:22 AM
Reading file names from a file and executing the relative file from shell script anushilrai Shell Programming and Scripting 4 03-10-2006 02:25 AM
NTFS corruption under w2k but not under suse 9.2 mickepe Windows & DOS: Issues & Discussions 4 08-05-2005 05:19 PM
data corruption with ftp transfer malcom UNIX for Advanced & Expert Users 12 08-04-2003 04:38 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-05-2002
Registered User
 

Join Date: Nov 2001
Location: Inida
Posts: 56
file corruption

Hi,

All of a sudden I landed in a strange problem.

I was working with my C source code in vi editor. I did a wq! and
when reopened, the file is full of "data".. I mean the text contents are gone!!.

I believe this is a file corruption. I have tried the -r option with vi, but no success.

Is there any way to recover the file. ??

Thanks in Advance...
Forum Sponsor
  #2  
Old 09-05-2002
Kelam_Magnus's Avatar
Registered User
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
backup backup backup ....

Go to /tmp or /var/tmp, depending on where your vi temp files go, and look for the files that are your buffer. They may still be there.
You might get lucky and be able to recover something.

Always make a backup of your scripts, it might save you from this in the future. I had a DBA that lost 3 hours worth of work because his telnet window died.

If you have some kind of incremental daily backup to pull from if this is a script you have been working on for a few days.
__________________
My brain is your brain
  #3  
Old 09-05-2002
flim flam flamma jamma
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
i have $20 that says he actually did a X! enter enter.

heh. no need to be ashamed if you diid a X vs x. you just used crypt on your file. heh. it happens.
  #4  
Old 09-05-2002
Registered User
 

Join Date: Nov 2001
Location: Inida
Posts: 56
Thumbs up

That was G R E A T ...... Kudos !

BTW, I was unaware of X! feature. .. Infact, this has happened ( like Enter Key: ) in between and I come out of that with :q.

I continued the editing.. and finally saved it, it got "crypted"..

thanks a lot for identifying it..

BTW, is there any way to uncrypt it... ?

Once again, that was a great point...
  #5  
Old 09-05-2002
Registered User
 

Join Date: Nov 2001
Location: Inida
Posts: 56
Hi..

I could find the decrypt method...

cat crypted_file | crypt > output_file

This will ask for "Enter Key" to decrypt the file..

Enter the key and recover the file...


BTW, unfortunately, I typed lot of ^H to come out of "Enter Key:" in vi editor without knowing the crypt feature..

.... And I lost there...
  #6  
Old 09-06-2002
Kelam_Magnus's Avatar
Registered User
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
You can also use crypt this way.

crypt < cryptfile.in > uncrypted.out


You may still be in trouble. Because I believe that you may not be able to recover what you typed as the password to crypt it.

__________________
My brain is your brain
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:55 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0