File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Recovery of file after removing it?

 
Minal Silimkar-Urankar
Ranch Hand
Posts: 136
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I removing a file using rm command, then "rm" command will delete a name-inode map from a directory.

Can I recover this removed file?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33680
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Minal,
Not easily if at all. If you have backups, you can do a restore from there. If not, you can look if there is a tool that can restore files (I don't know if there is one.) Even then, that assumes the file has been overwritten yet.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Linux file systems aren't like FAT disks. The best thing to do in this case is IMMEDIATELY shut the machine off, and bring it up in single-user mode with the disk containing the deleted file mounted read-only (this may mean booting off of a CD, or even moving the disk to another machine.) Then you can dump the partition with the deleted file using "dd"; now you've got all the remaining data in that dump, and you can reboot the machine normally.

Now, if the deleted file was a text file, you can just search the dump file for some text you know was in the deleted file. If it was something binary, then there are a few programs that can help you examine the dump, depending on what type of file system it was. For an ext2fs partition, there's the "recover" command (Google "Linux recover deleted files").
 
Pat Farrell
Rancher
Posts: 4660
5
Linux Mac OS X VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
most of the linux gui shells, gnome or kde, have a 'trash' folder, so you can 'undelete' from it. The shell 'rm' commands are pretty close to final. That's why God invented SVN
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic