ReiserFS undelete/data recovery HOWTO

These steps are only for really bad hard disk muck-ups and accidentally deleted files. For normal filesystem inconsistencies, don't use these steps!

  1. Once you realize that you've lost data, don't do anything else on that partition - you may cause that data to be overwritten by new data.
  2. Unmount that partition. e.g., umount /home
  3. Find out what actual device this partition refers to. You can usually get this information from the file /etc/fstab. We'll assume here that the device is /dev/hda3.
  4. Run the command: reiserfsck --rebuild-tree -S -l /root/recovery.log /dev/hda3

    You need to be root to do this. Read the reiserfsck man page for what these options do and for more options. Some interesting options are '--rebuild-sb, --check'

    After the command finishes, which might be a long time for a big partition, you can take a look at the logfile /root/recovery.log if you wish.

  5. Mount your partition: mount /home
  6. Look for the lost+found directory in the root of the partition. Here, that would be: /home/lost+found
  7. This directory contains all the files that could be recovered. Unfortunately, the filenames are not preserved for a lot of files. You'll find some sub-directories - filenames within those are preserved!
  8. Look through the files and copy back what you need.

Here's a useful link for more advanced tricks.

 

 

     I just want to thank for the tips on recovering deleted files. I've just wrongly deleted some files and been able to recover them by following your steps / steps from pages mentioned herein. Instead of finding deleted files in lost+found directory, I've ended up finding them in the original directories (from where they were deleted). I've compiled the sequence of steps for my specific case (slight changes will suit particular issues regarding unwanted file deletion), which follows:

Recover deleted files (from /home = /dev/hda7)
0. Unmount partition from where to recover deleted files

        umount /home

1. Create partition copy

        dd if=/dev/hda7 conv=noerror > /hda7.img

2. Set up device containing copy of partition (created in 1.)

        losetup /dev/loop/0 /hda7.img

3. Rebuild FS tree, performing a thorough partition scan and logging to /recovery.log file

        reiserfsck --rebuild-tree -S -l /recovery.log /dev/loop/0

(4. Check written log file)

        (less /recovery.log)

5. Create directory for mounting recovered partition

        mkdir /recovery

6. Mount recovered partition in directory created in 5.

        mount /dev/loop/0 /recovery

7. Access recovered partition's lost+found directory and look for files

        cd /recovery/lost+found

8. If not there (7.), then look for in original directory

        cd /recovery/

9. Remount /home partition

        mount /home

10. Copy recovered files from 7./8. to /home/

        cp /recovery// /home//
11. Unmount recovered partition
        umount /recovery
12. Detach recovered partition device
        losetup -d /dev/loop/0

@nT$

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值