Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Undelete for reiserfs?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
surak
n00b
n00b


Joined: 10 May 2002
Posts: 56
Location: upper-right coast

PostPosted: Sat Nov 16, 2002 2:36 am    Post subject: Undelete for reiserfs? Reply with quote

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
View user's profile Send private message
asimon
l33t
l33t


Joined: 27 Jun 2002
Posts: 979
Location: Germany, Old Europe

PostPosted: Sun Nov 17, 2002 12:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
c_kuzmanic
Guru
Guru


Joined: 18 Apr 2002
Posts: 488
Location: Los Angeles , California

PostPosted: Sun Nov 17, 2002 10:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
c_kuzmanic
Guru
Guru


Joined: 18 Apr 2002
Posts: 488
Location: Los Angeles , California

PostPosted: Mon Nov 18, 2002 12:01 am    Post subject: Reply with quote

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
View user's profile Send private message
c_kuzmanic
Guru
Guru


Joined: 18 Apr 2002
Posts: 488
Location: Los Angeles , California

PostPosted: Mon Nov 18, 2002 12:26 am    Post subject: Reply with quote

And here's a very fancy and easy to use trash can script:

http://www.yoursitemaster.com/open_source/projects/trashcan/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum