LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 08-28-2007, 06:06 AM   #1
konfigure
Member
 
Registered: Jul 2005
Distribution: Slackware 12.2
Posts: 54

Rep: Reputation: 15
undelete data in ext3


hi, I accidentally delete a tar.gz file in my folder, anyone know how to undelete it? pleas help me...
 
Old 08-28-2007, 07:29 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
The quick answer is "you can't". While ext2 has undelete programs available
they don't work on ext3. The long answer: if you have time, know the content
of the file (and rougly it's size) you may be able to locate it on the raw
device via grep and then output the sectors belonging to it to a new file...

Not a trivial task, though.



Cheers,
Tink
 
Old 08-28-2007, 07:34 PM   #3
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Just googled this up so no guarantees, warranties, etc,

http://sourceforge.net/projects/giis/

May help out next time.
Good luck. ;-)

Last edited by Peacedog; 08-28-2007 at 07:37 PM. Reason: Forgot link!!!
 
Old 08-28-2007, 07:35 PM   #4
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
You could try using photorec and narrowing the search down to tar files - but it will take you a good deal of time. Unless you really, really need the file back, it's hardly worth the effort.
 
Old 09-01-2007, 10:20 PM   #5
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
Even on ext3, you can get it back if you want it bad enough. Normal ext2 recovery programs don't work well on ext3 because no inode data is available. But you can use abandoned block lists to find files that are longer than 12 blocks. (A block is usually 4096 bytes.) If your C skills are sharp and you need the file bad enough, your chances are good. Go to wikipedia and look up ext2; follow the external links. You will need /usr/include/linux/ext2_fs.h.

Your luck will be better if you do this before smearing the mud around on the filesystem in question.

Hope this helps.

Last edited by wjevans_7d1@yahoo.co; 09-01-2007 at 10:22 PM.
 
Old 09-02-2007, 07:28 AM   #6
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
Quote:
Originally Posted by konfigure View Post
hi, I accidentally delete a tar.gz file in my folder, anyone know how to undelete it? pleas help me...
testdisk
then you can copy the file recovered (if you are lucky , but looks done)
 
Old 09-03-2007, 10:03 AM   #7
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
AFAIK, testdisk is used for recovering partitions, and that wasn't the OP's problem.

My wife tried photorec. On the first drive she tried, everything was recovered in pieces; not good for a .tgz file. On the second drive she tried, it got twisted into a weird loop, creating directory after directory with only one file in each: the same file.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Data rescue on ext3 e-Gandalf Linux - Software 7 03-27-2007 11:10 PM
recover ext3 data holdrio Linux - Software 2 06-21-2006 10:10 AM
ext3 data recovery? hollywoodb Linux - General 4 03-28-2006 04:41 AM
undelete files on ext3 santner Linux - General 0 04-27-2004 08:06 AM
Help w/ undelete (ext3) steppin_razor Linux - General 1 02-28-2002 06:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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