LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-19-2008, 10:50 AM   #1
uhcafigdc
Member
 
Registered: Oct 2008
Distribution: Debian Lenny
Posts: 39

Rep: Reputation: 15
Undelete? Data recovery?


After doing rm on a file in ext3, or shift+delete in Ubuntu, how can I get the file back? After a Google search I am finding a lot of expensive data recovery software, but it isn't worth the money.
 
Old 11-19-2008, 10:56 AM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
I found this on google. Never tried it though...
 
Old 11-19-2008, 11:01 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
The most commonly recommended tools are photorec and testdisk (both from the same source: http://www.cgsecurity.org/wiki/TestDisk )
 
Old 11-19-2008, 11:03 AM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
The only issue with photorec and testdisk (both are great tools for failed systems though where you're just desperate to get anything back) is that you will recover all files of a type and then weed through the results to find what you're looking for. If you have thousands of photos, for example, this can be very labor intensive and disk space intensive.
 
Old 11-19-2008, 11:10 AM   #5
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
You could try running command: photorec from a live CD. It is part of the testdisk package but you don't want to install it in the system that you lost the file in, as a matter of fact, you would want to reduce the amount you use the file system containing your lost file as much as possible to avoid overwriting it.
If the file is intact and still there, photorec will recover it. If it is still there but fragmented, you may still be able to recover it but this requires allot of studying and using sleuthkit along with photorec.
Sleuthkit can tell you exactly where the file's inode is.
A forensics live CD will have all these data recovery tools. Try the Helix Live CD.
 
Old 11-19-2008, 11:29 AM   #6
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
As root, the example command below should show all deleted files using sleuthkit and their inode # and directory. Although I have not tried it on ext3 file system personally.
Code:
fls -rd /dev/sda1 | less 
    d/d * 232: /TEMP-823450 
    r/d * 293: /TEMP-131100

The “d/d” follows the format of directory entry value type value 
and the second letter is the type according to the inode. The “d” 
stands for directory, and the “r” stands for file. In most instances, 
these should match. However, in the case of deleted files where the inode has been reallocated, it will not. 
The asterisk “*” shows that it is deleted. The number following is the inode number. 
After this is the full path of the deleted files.
If you figure out where your deleted file is, and you know it's size more or less, you can use dd to extract an image of that section of the file system and work on the image to recover the file and continue using the OS. It is advised to make an image of the entire block containing the file in case it is fragmented. It is not usual for a file to be written to more than one block unless it's size exceeds that of the block size.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
file recovery/undelete on fat-system t0bias Linux - Hardware 2 09-04-2007 05:18 AM
undelete data in ext3 konfigure Linux - General 6 09-03-2007 10:03 AM
LXer: Linux Data Recovery on Windows - Is possible through Disk Doctors Linux Recovery Software LXer Syndicated Linux News 0 10-22-2006 12:21 PM
Data Recovery scbops Linux - Security 4 04-24-2006 05:51 AM
need some help about data recovery! belkens Linux - Software 1 05-11-2005 04:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:52 AM.

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