您的位置:首页 > 运维架构 > Linux

CentOS6.5恢复误删除的文件

2016-06-12 10:11 821 查看
系统环境:CentOS release 6.5 (Final)

内核版本:2.6.32-431.el6.x86_64

需要的源码包:extundelete-0.2.4.tar.bz2

解压bz2包:

# tar -jxvf extundelete-0.2.4.tar.bz2

cd extundelete-0.2.4

./configure

报错:

configure: error: C++ compiler cannot create executables

解决办法:

# yum install gcc gcc-c++ gcc-g77 –y

将gcc组件安装完整

./configure

报错:

configure: error: Can't find ext2fs library

解决办法:

# yum -y install e2fsprogs-devel

# ./configure

Configuring extundelete 0.2.4

Writing generated files to disk

出现上面消息说明安装成功:将生成的文件写入磁盘

1、通过inode节点恢复

扫描/dev/sdb1

# extundelete /dev/sdb1 --inode 2



恢复文件

# extundelete /dev/sdb1 --restore-inode 14

2、通过文件名恢复

# extundelete /dev/sdb1 --restore-file zhangsan

3、恢复某个目录

# extundelete /dev/sdb1 --restore-directory nimei

4、恢复所有文件

# extundelete /dev/sdb1 --restore-all

以上恢复方法只针对非空的文件,RHEL7的xfs是可以将空文件恢复
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: