真对那些没有日志机制的旧有文件系统,scalpel 工具是一个很好的选择。scalpel 是快速文件恢复工具,经过读取文件系统的数据库来恢复文件。它是独立于文件系统的。
[root@rhel6 ~]# wget https://codeload.github.com/machn1k/Scalpel-2.0/zip/master
[root@rhel6 ~]# unzip Scalpel-2.0-master.zip
[root@rhel6 ~]# cp Scalpel-2.0-master /usr/src/ -r
[root@rhel6 ~]# cd /usr/src/Scalpel-2.0-master/
[root@rhel6 Scalpel-2.0-master]# ./configure
[root@rhel6 Scalpel-2.0-master]# make && make installgit
使用 scalpel 工具以前,首先要修改配置文件: /etc/scalpel/scalpel.conf。
例如用户要恢复全部删除 pdf 文件,那么要编辑配置文件将 pdf 两行以前注释去掉。
[root@rhel6 ~]# vim /etc/scalpel/scalpel.conf。
[...]
pdf y 5000000 %PDF %EOF\x0d REVERSE
pdf y 5000000 %PDF %EOF\x0a REVERSE
[...]github
使用方法:
[root@rhel6 ~]# scalpel /dev/sdb1 -o /RECOVERY/
其中/dev/sdb1 是目标驱动器,/RECOVERY/ 是恢复文件存储目录。目录下的 audit.txt 文件是恢复文件列表。数据库
切记:硬盘有价,数据无价!!
vim