Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 75541 - New package proposal: recover to undelete files on ext2
Summary: New package proposal: recover to undelete files on ext2
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High enhancement
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-24 05:32 UTC by Martin Mokrejš
Modified: 2005-05-21 00:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2004-12-24 05:32:46 UTC
I just had to google around to find how to undelete some file on reiserfs, no luck so far except I can still grep the text on /dev/hda3. Soo, not that bad!

Anyway, I found possibly nice tools for ext2 users:
http://recover.sourceforge.net/linux/recover/
http://recover.sourceforge.net/linux/recover/download.php3
Comment 1 Andrej Kacian (RETIRED) gentoo-dev 2004-12-25 09:47:36 UTC
I've tried it to recover a freshly (20 seconds ago) removed file, but this utility did not find anything. Is it actually working?
Comment 2 Martin Mokrejš 2005-01-03 01:11:12 UTC
Well, I haven't tried myself as I needed undelete on reiserfs, but have created ext2 on usb flashdisk on sdb. Unfortunately, I get coredumps. I'll contact the author about this problem. I use 2.6.10-rc3-bk16.

# recover /dev/sdb
Recover v1.3b by Tom Pycke <Tom.Pycke@advalvas.be>

Getting inodes (this can take some time)...
debugfs 1.35 (28-Feb-2004)
Segmentation fault (core dumped)
# gdb /usr/bin/recover core
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

Core was generated by `recover /dev/sdb'.
Program terminated with signal 11, Segmentation fault.

warning: current_sos: Can't read pathname for load map: Input/output error

Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  0x08048ffb in get_inodes (device=0xbffff29c "/dev/sdb") at recover.c:203
203     cur_inode->next_inode = NULL;
(gdb) where
#0  0x08048ffb in get_inodes (device=0xbffff29c "/dev/sdb") at recover.c:203
#1  0x08049e88 in start_it (device1=0xbffff29c "/dev/sdb", all=0) at ui.c:239
#2  0x0804978e in main (argc=2, argv=0xbfffd464) at recover.c:412
(gdb) bt full
#0  0x08048ffb in get_inodes (device=0xbffff29c "/dev/sdb") at recover.c:203
 temp = "    12      0 100644 122951   13/  13 Mon Jan  3 10:04:38 2005\n\000&#282;&#270;&#729;&#380;
Comment 3 Martin Mokrejš 2005-01-03 01:11:12 UTC
Well, I haven't tried myself as I needed undelete on reiserfs, but have created ext2 on usb flashdisk on sdb. Unfortunately, I get coredumps. I'll contact the author about this problem. I use 2.6.10-rc3-bk16.

# recover /dev/sdb
Recover v1.3b by Tom Pycke <Tom.Pycke@advalvas.be>

Getting inodes (this can take some time)...
debugfs 1.35 (28-Feb-2004)
Segmentation fault (core dumped)
# gdb /usr/bin/recover core
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

Core was generated by `recover /dev/sdb'.
Program terminated with signal 11, Segmentation fault.

warning: current_sos: Can't read pathname for load map: Input/output error

Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  0x08048ffb in get_inodes (device=0xbffff29c "/dev/sdb") at recover.c:203
203     cur_inode->next_inode = NULL;
(gdb) where
#0  0x08048ffb in get_inodes (device=0xbffff29c "/dev/sdb") at recover.c:203
#1  0x08049e88 in start_it (device1=0xbffff29c "/dev/sdb", all=0) at ui.c:239
#2  0x0804978e in main (argc=2, argv=0xbfffd464) at recover.c:412
(gdb) bt full
#0  0x08048ffb in get_inodes (device=0xbffff29c "/dev/sdb") at recover.c:203
 temp = "    12      0 100644 122951   13/  13 Mon Jan  3 10:04:38 2005\n\000&#282;&#270;&#729;&#380;ý&#729;&#729;&#729;\000\000\000\000 \227&#355;&#711;h\222&#355;&#711;&#321;\234y\006@&#272;&#729;&#380;&#272;\b\000¸\n\206\004\b\000 &#355;&#711;\f\207\004\b4\224&#283;&#711;h\222&#355;&#711;&#345;\001\000¸\002\000\000\000&#345;\001\000¸\000\000\000\000\004&#272;&#729;&#380;îh&#729;&#711;\000\000\000\000d&#377;&#283;&#711;", '\0' <repeats 12 times>, "I\035&#729;&#711;\004\a\000¸\000\000\000&#272;\b\000¸P&#272;&#729;&#380;YN&#729;&#711;p\n\000¸@\225&#355;&#711;\001\000\000\000\001", '\0' <repeats 11 times>...
 dummy = "\003\000\000\000\020\225&#355;&#711;@\225&#355;&#711;"
 num_del_inodes = -1208053144
 x = 0
 pid = -1209225916
 fd = {0, 0}
 blocks = 32
 cur_inode = (inode *) 0x7
 lastinode = (inode *) 0x0
 firstinode = (inode *) 0x8048675
 list = (FILE *) 0x804c770
#1  0x08049e88 in start_it (device1=0xbffff29c "/dev/sdb", all=0) at ui.c:239
 year = -1208186392
 maxday = -1209133963
 minday = -1208004560
 maxmin = -1073753080
 minmin = -1207958400
 maxhour = 0
 minhour = 32
 uid = 975778099
 ch = 670249
 minsize = 1936289384
 maxsize = 1667851642
 result = 1919243816
 inode_numb = 541027941
 count = 1685218679
 weekd = "\000:\n"
 month = "en?\n"
 device = 0x804c050 "¤\225ü&#711;¤\225ü&#711;"
 dir = "HERE\000OL\000\000\000\000\0008Ó&#729;&#380;\034Ó&#729;&#380;i&#355;&#283;&#711;\000\000\000\000\000\000\000\000#\000\000\000&#731;vl\v\220Ó&#729;&#380;&#272;\b\000¸I\206\004\bD­&#283;&#711;Ô#&#283;&#711;´ &#283;&#711;h\222&#355;&#711;\020\225&#355;&#711;@\225&#355;&#711;\004\a\000¸\000\000\000\000p\n\000¸&#341;Ó&#729;&#380;&#328;\035&#729;&#711;Usted desea filtrar de nuevo l"
 command = 0x804c668 ""
 text_str = "J&#346;&#324;&#711;\003\000\000\000&#269;\211ü&#711;P&#340;\004\bl&#323;&#729;&#380;Ô\003&#324;&#711;P&#340;\004\b\000&#273;é&#711;2&#367;&#273;&#711;\001\000\000\000&#269;\211ü&#711;H&#327;&#729;&#380;&#272;V&#273;&#711;P&#340;\004\b \000\000\000zS?\000¤\201\000\000É`&#729;&#711;M\205\004\b\020\v\000¸\004\a\000¸\000\000\000\000\000\000\000\000x&#323;&#729;&#380;F\032&#729;&#711;s&#355;&#283;&#711;k\206\004\b\000\000\000\000&#369;\n&#366;A0", '\0' <repeats 11 times>, ",&#729;&#283;&#711;D­&#283;&#711;Ô#&#283;&#711;h\222&#355;&#711;\003\000\000\000\020\225&#355;&#711;P\225&#355;&#711;\004\a\000¸\000\000\000\000p\n\000¸ &#327;&#729;&#380;&#328;\035&#729;&#711;\003\206\004\b\2256&#280;\006|\204\004\bÜ&#323;&#729;&#380; \n\000¸\001\000\000\000P"...
 buf = 0x804c0d8 "\034\225ü&#711;\034\225ü&#711;"
 c = 0 '\0'
 firstinode = (inode *) 0x804c050
 startinode = (inode_list *) 0x804c148
 tmp_inode = (inode_list *) 0xb80001f8
 tmp = (FILE *) 0x0
#2  0x0804978e in main (argc=2, argv=0xbfffd464) at recover.c:412
 lang = "/DEV/SDB\000Ô&#729;&#380;$\215ü&#711;&#269;\211ü&#711;\224V&#729;&#711;\221&#317;\004\b&#269;\211"
 tmp = 0x8048859 "É&#258;" <Address 0x804885b out of bounds>
 device = 0xbffff29c "/dev/sdb"
 x = 8
 all = 0
(gdb) 
Comment 4 Martin Mokrejš 2005-01-04 04:16:14 UTC
Here's an answer from Tom Pycke, who wrote this recover tool:

"Recover uses the debugfs program. Unfortunately, those guys keep changing the format of their output, and I stopped changing recover. It's probably just one line that needs to be changed, but, well, I stopped doing it."
Comment 5 SpanKY gentoo-dev 2005-05-21 00:36:26 UTC
no point in adding a package that's not maintained ...