UNIX Recovery

Hi

I changed a file in Vi editor but couldnt save it as it gave a message that file system is full.So we came out without saving it but later on we found that CONTENT OF FILE GOT ERASED and we are no more able to view that file.
This file is an important configuration file .

Can somebody help me to recover the file,PLzzzzzzz?????

Please suggest a detail procedure.

Thanks,

:confused:

Next time you are in VI and try to save a file and the filesystem if full, remember you can execute shell commands from the VI command line. You then can delete enough /tmp files to save your work.

I don't know of any way to recover this file, Sorry.

I do. It's called a restore. You do have backups, right?

Remember the old adage: Save early, save often!

Yes, but the problem, as I read the original post, was that the poster was editing a file in VI and could not save because the file system was full. Hence, there is nothing to restore because the user was in memory space and could not save the file to disk because of a filesystem full error.

Where can you save often when the filesystem is full and there is no place to save?

If you have a backup then you can retrieve the particular file from the backup and do the changes that got erased. If the backup is not there then i don't think there is a way to get the file back.

I think it's not possible revover your file sorry!! :frowning:

He said he changed a file, so at least he should be able to restore the original, and redo the changes...

Provided he has a backup of the file

It is after the fact, but in the future you can attempt a recover by forcing the editor to preserve your buffer. You will find this useful if you have made edits, then discover that you can't save your edits. You can then use the vi -r <file> to recover the buffer after you close.

If the file system is full you can also delete something with :! rm <junkfile> the !(bang) allows you to issue unix commands within the editor, like : !df to see the space.

Best case, write the file to a directory in another filesystem that has space available with :w /usr/local/../.../file

Daivd