how to recover file?

I am using Freebsd 3.1 Release. I "rm" a file, and I need to recover it. Who can help me? Urgent!!!
Who is Participating?
donnerConnect With a Mentor Commented:
The rm command unlinks the inode and removes the name from the directory.  There are only three ways you might recover the file:

1 - if the file had a link to it from somewhere else.  The file only actually gets deleted from the physical disk when the reference count, the number of hard links that actually
point at the physical file, goes to zero.  If you removed the last link, then you're probably hosed.

2 - if you shut down the system immediately after you removed the file you *might* be able to bring it up single user and then rummage around the raw device and find the blocks that used to be the file.

3 - if you had backed up the system recently, you could find the file on the backup media.

I don't believe that there is anything like the Windows "recycle bin" in that system.  If it existed, it would almost certainly be implemented as a change to the rm(1) program, so
doing "man 1 rm" would tell you what you might do to recover the file.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.