[NBLUG/talk] Executed "rm -rf *" in the wrong directory!

Lincoln Peters sampln at sbcglobal.net
Sun Nov 30 00:40:03 PST 2003


This may be of interest to anyone on the list (or reads the online
archives) who uses the reiserfs filesystem:

I finally bought a new hard disk, plugged it into the IDE port that
normally connects to my CD-ROM drive, formatted it with ext3, then used
it to create a backup image of the filesystem with the lost data:

# mkfs -t ext3 /dev/hdb1
# mount -t ext3 /dev/hdb1 /home.recovered
# dd if=/dev/hdc1 of=/home.recovered/home.backup.img

It took about 13 hours for the backup to complete (/dev/hdc1 is 60 gigs,
but I had not yet tried to tune anything with hdparm on Debian).  Once
it completed, I ran the only command that I found could recover deleted
files from a reiserfs filesystem:

# reiserfsck --rebuild-tree --scan-whole-partition /dev/hdc1

About 5 minutes into this process, it finally dawned on me that, had I
set up hdparm prior to all of this, I could have shaved several hours
off of this procedure.  However, I had no interest in interrupting the
reiserfsck command (and possibly making the situation even worse).

The entire process completed at about 11:00pm tonight.  I then
re-mounted the filesystem and looked for my files:

# mount -t reiserfs /dev/hdc1 /home

It looks like I have all 1,083 of my files back (total 2.4GB), but I've
lost all of their names.  They are now numbered and stored in
/home/lost+found.  This may yet be a while, but at least I got the files
back.


I still haven't figured out that ATA controller that came with the new
hard drive.




More information about the talk mailing list