环境:rhel6.5
给虚拟主机添加一块磁盘,磁盘为/dev/vdb 格式化ext4格式,因为它恢复只支持ext2,3,4等格式
[[email protected] ~]# mount /dev/vdb /mnt/disk/
[[email protected] ~]# cd /mnt/disk/
[[email protected] disk]# cd lost+found/
在当磁盘下cop点东西
[[email protected] lost+found]# ls
boke
工具安装部署
官方网站是http://extundelete.sourceforge.net/ ,其目前的稳定版本是extundelete-0.2.4.
编译:
[[email protected] ~]#yum -y install gcc-c++ e2fsprogs.x86_64 e2fsprogs-devel.x86_64
[[email protected] ~]#tar -jxvf extundelete-0.2.4.tar.bz2
[[email protected] ~]#cd extundelete-0.2.4
[[email protected] ~]#./configure
[[email protected] ~]#make && make install
验证安装结果
[[email protected] ~]#extundelete -v
[[email protected] lost+found]# extundelete /dev/vdb --inode 2
#扫描
. 2
.. 2
#最后几行lost+found 11
boke 131073 Deleted
[[email protected] lost+found]# extundelete /dev/vdb --restore-directory boke
[[email protected] lost+found]# ls #生成文件夹
RECOVERED_FILES
[[email protected] lost+found]# cd RECOVERED_FILES/
[[email protected] RECOVERED_FILES]# ls #查看
boke book
先恢复文件(可根据文件名进行恢复):
extundelete /dev/sdb --restore-file
恢复目录(根据目录名恢复):
extundelete /dev/sdb --restore-directory
总结:可用但不理想,恢复文件不是源目录而是自动排列,二次扫描恢复就不行了
原文地址:http://blog.51cto.com/13810716/2329252