View previous topic :: View next topic |
Author |
Message |
surak n00b
Joined: 10 May 2002 Posts: 56 Location: upper-right coast
|
Posted: Sat Nov 16, 2002 2:36 am Post subject: Undelete for reiserfs? |
|
|
Well I just did a very stupid thing and accidently rm -r'd the dir with all my music in it. Yay. Anyway, I happen to use reiserfs and after some googling, could not find any file recovery tools or methods. But I've tried to limit disk activity and am pretty sure the files still exist in some form or another. debugreiserfs -D /dev/hda4 | grep "Pink Floyd", gives me output like:
Code: | 32: "Pink Floyd - Fat Old Sun.mp3"( 29) [6 125] 1925799936 0, loc 1576, state 4 "r5"
33: "Pink Floyd - Bike.mp3 "( 21) [6 8] 1934860672 0, loc 1552, state 4 "r5"
|
So I don't think they're gone forever, but how do I get them back? Any ideas? |
|
Back to top |
|
|
asimon l33t
Joined: 27 Jun 2002 Posts: 979 Location: Germany, Old Europe
|
Posted: Sun Nov 17, 2002 12:10 pm Post subject: |
|
|
It seems there are not that many reiserfs gurus in this forum. But there is a reiserfs mailing list on www.namesys.com where all the reiserfs gurus hang around. Maybe you find help there. If you do a search in the archive there you can find some postings where people did get their deleted files back with something like 'reiserfsck --rebuild-tree --scan-whole-partition'.
Cheers,
Andreas |
|
Back to top |
|
|
c_kuzmanic Guru
Joined: 18 Apr 2002 Posts: 488 Location: Los Angeles , California
|
Posted: Sun Nov 17, 2002 10:12 pm Post subject: |
|
|
Be prepared that 'reiserfsck --rebuild-tree --scan-whole-partition' might cause more problems than fix them. I learned this the hard way when I accidentally deleted my /etc directory. The best thing to do is to use a script that replaces the default rm command and moves everything that is deleted into a user-defined trashcan. There are several such 'safe-undelete' scripts floating around, try freshmeat or sourceforge. |
|
Back to top |
|
|
c_kuzmanic Guru
Joined: 18 Apr 2002 Posts: 488 Location: Los Angeles , California
|
Posted: Mon Nov 18, 2002 12:01 am Post subject: |
|
|
Ok, here's a very simple script I made which will move any files you may want to delete to a user-defined trash can. To install, simply copy the script below into a file, name it rm-s and copy it into /usr/bin.
#!/bin/bash
# Configure options below
TRASHDIR=/home/master/Desktop/Trash # Path to trashcan directory, in this case my kde trashcan
# Main Program
E_WRONGARGS=65
if [ -z "$1" ];then
echo " Usage: `basename $0` [filename]"
exit $E_WRONGARGS
fi
if [ -n "$1" ] && [ -e "$1" ];then
mv -f $1 $TRASHDIR
echo " $1 has been moved to $TRASHDIR"
exit
fi
if [ ! -e "$1" ];then
echo " File $1 does not exist!"
echo " Usage: `basename $0` [filename]"
exit $E_WRONGARGS
fi |
|
Back to top |
|
|
c_kuzmanic Guru
Joined: 18 Apr 2002 Posts: 488 Location: Los Angeles , California
|
|
Back to top |
|
|
|