• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Recovery of file after removing it?  RSS feed

 
Ranch Hand
Posts: 136
  • 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?
 
author & internet detective
Posts: 38921
686
Eclipse IDE Java VI Editor
  • 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.
 
author and iconoclast
Posts: 24203
40
Chrome Eclipse IDE Mac OS X
  • 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").
 
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!