vi recovery

Ok, so my system just crashed.
In folder I see vi.core file.
Root has received mail that can use:
Code:
# vi -r cool_text
to recover a file.

Now, when I hit:
Code:
# vi -r
I get a list of files to recover:
Code:
Mon Nov  9 21:15:02 2009: foo
Mon Nov 23 00:58:52 2009: bar
Tue Nov 24 04:46:11 2009: cool_text
Thu Dec  3 13:48:29 2009: cool_text
Fri Dec  4 16:13:47 2009: cool_text

If I do:
Code:
# vi -r cool_text
I get:
There are older versions of this file for you to recover; There are other files for you to recover;
and wana save it with
Code:
:w cool_text_C
Error: cool_text_C: Bad address; cool_text_C: WARNING: FILE TRUNCATED.
What now?

Also, when I go forward(CTRL-F) to the end of that file, I get "expeled" in cmd.(like in "more" command).
In vi it should not happen but beep
 
It's not your system that's crashing. It's vi that is, for some reason. Try to see if the file is really truncated with cat or ee.
I suspect something funny is happening with the filesystem. Do a fsck.

EDIT: you know what? Check the disk for bad blocks too (e.g. dd if=/dev/<disk> of=/dev/null bs=1m).
 
Beastie said:
It's not your system that's crashing. It's vi that is, for some reason. Try to see if the file is really truncated with cat or ee.
I suspect something funny is happening with the filesystem. Do a fsck...

I do not know, how to refer to any of those files.
Where are they?
 
Yes guys, those files are in /var/tmp/vi.recover
Thanks.

Now when it works:
Code:
# vi -r cool_text
And get recovered file(truncated). Then I have chance to save it or if I:
Code:
:q!
it is lost forever.
 
Whoa!
This is unbelievable!
Just now, when I came across third file for recovery and have seeking through it, it's size started to increase at crazy rate, while open in editor!!!

From ie: 42kb, It skyroceted to 1.7 GB!
And caused this:
Code:
/dev/ad4s3d    1.9G    1.9G   -149M   108%    /var

xterm freezed and I had to delete it and open another one, to get rid of that file.

Now what was that?!
 
Back
Top