Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-26-2007, 09:41 PM   #1
Registered: Mar 2005
Location: Australia
Posts: 71

Rep: Reputation: 15
recover lost files

i accidentedly deleted some files, does anyone know how to recover them from "command line"?
Old 01-26-2007, 10:04 PM   #2
Registered: Dec 2006
Location: Germany
Distribution: Kubuntu (Feisty Fawn), Debian (SID)
Posts: 127

Rep: Reputation: 15
Be warned, this is not trivial... :-(

For the future I suggest you to have a look at this
It is a wrapper library (LD_PRELOAD hack) around the system calls which Linux uses when deleting files, and which moves them to a configurable location instead.

However, for now, it might be easy but it might be as well impossible.

I once read that you should for heaven's sake not unmount and re-mount the partition (that is, not reboot!).

If there is still any process running which holds the specific file open, then you're lucky and just copy the file descriptor from the /proc directory.
Here's a guide for that:

There are utilities for ext2 based file systems. One is called recover, and one e2undel. But you need to remember some informations about the files. And it won't work with ext3...

Also, depending on file type you might want to try forensic utilities. These scan the whole partition for "magic bytes"/headers of known filetypes and *try* to restore them.
* magicrescue
* foremost
* probably others... search for 'forensic' in your package manager

good night, and good luck


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost My Files--Help needed to recover them svasanth Linux - Newbie 2 09-06-2006 03:51 AM
**Reinstalled, need to recover lost files aspinnler Ubuntu 6 02-08-2006 05:48 PM
rm -R, lost my files, any way to recover? mm.. :) brynjarh Linux - General 1 05-10-2005 06:39 AM
recover lost DOS files 90-60-90 General 5 02-16-2005 09:41 PM
Recover lost files? chup Linux - General 2 08-23-2003 10:28 AM

All times are GMT -5. The time now is 05:39 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration