码迷,mamicode.com
首页 > 其他好文 > 详细

使用extundelete恢复测试liunx的删除文件

时间:2018-12-12 11:21:50      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:++   测试   rhel   directory   dir   roo   编译   root   环境   

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

extundelete /dev/sdb --restore-file

恢复目录(根据目录名恢复):

extundelete /dev/sdb --restore-directory

总结:可用但不理想,恢复文件不是源目录而是自动排列,二次扫描恢复就不行了

使用extundelete恢复测试liunx的删除文件

标签:++   测试   rhel   directory   dir   roo   编译   root   环境   

原文地址:http://blog.51cto.com/13810716/2329252

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!