LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   undelete data in ext3 (https://www.linuxquestions.org/questions/linux-general-1/undelete-data-in-ext3-580371/)

konfigure 08-28-2007 06:06 AM

undelete data in ext3
 
hi, I accidentally delete a tar.gz file in my folder, anyone know how to undelete it? pleas help me...

Tinkster 08-28-2007 07:29 PM

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

Peacedog 08-28-2007 07:34 PM

Just googled this up so no guarantees, warranties, etc,

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

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

jay73 08-28-2007 07:35 PM

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.

wjevans_7d1@yahoo.co 09-01-2007 10:20 PM

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.

frenchn00b 09-02-2007 07:28 AM

Quote:

Originally Posted by konfigure (Post 2873187)
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)

wjevans_7d1@yahoo.co 09-03-2007 10:03 AM

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.


All times are GMT -5. The time now is 07:32 PM.