Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 07-28-2005, 06:40 PM   #1
Senior Member
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 50
undeleting ext3 files


I have Debian Sarge installed on ext3

by mistake I've deleted some important TEXT files

how I know, ext3 data structures do not support any method of undeleting

I've heard there is only a one posibbility using grep, but know someone how it works ?

kind regards

Last edited by cccc; 07-28-2005 at 07:32 PM.
Old 07-29-2005, 02:18 AM   #2
Registered: Oct 2003
Distribution: Knoppix
Posts: 103

Rep: Reputation: 15
Basically, deleting a file in ext3 removes references to the file, but not the actual file. What you need to do is something like:

grep -a -C 40 -i "important document" /dev/hda > output.txt
The -a enables the binary /dev/hda file to be treated as text, the -C 40 gives 40 lines of context around the line you are searching for, the "important document" is a line that you remember from the document (in quotes), the /dev/hda is the location of the actual hard drive, and the > output.txt routes the output to a text file.

Adjust the options as needed.

As a final note, turn off the computer ASAP, and do all this via Knoppix (or similar) if at all possible. Any time a file will be written to the disk, there is a chance the important files will be overwritten. Also make sure the output file does not reside on the drive in question. (Knoppix home directory would be a good option.)
Old 07-31-2005, 06:23 AM   #3
Senior Member
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 50
thanks !


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
undelete files on ext3 santner Linux - General 0 04-27-2004 08:06 AM
Undeleting ReiserFS Files KingofBLASH Linux - General 1 12-29-2003 04:10 PM
undeleting accidentally deleted files darksarin Linux - Newbie 3 11-21-2003 08:08 AM
recover files in ext3 hana_abe Linux - Newbie 3 11-16-2003 09:46 AM
Need help undeleting... Kobinator Linux - General 6 10-26-2003 04:43 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:59 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