Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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...
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.