系統環境:CentOS release 6.5 (Final)node
內核版本:2.6.32-431.el6.x86_64c++
須要的源碼包:extundelete-0.2.4.tar.bz2spa
解壓bz2包:rest
# tar -jxvf extundelete-0.2.4.tar.bz2blog
cd extundelete-0.2.4源碼
./configureit
報錯:table
configure: error: C++ compiler cannot create executablesgcc
解決辦法:file
# 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
出現上面消息說明安裝成功:將生成的文件寫入磁盤
一、經過inode節點恢復
掃描/dev/sdb1
# extundelete /dev/sdb1 --inode 2
恢復文件
# extundelete /dev/sdb1 --restore-inode 14
二、經過文件名恢復
# extundelete /dev/sdb1 --restore-file zhangsan
三、恢復某個目錄
# extundelete /dev/sdb1 --restore-directory nimei
四、恢復全部文件
# extundelete /dev/sdb1 --restore-all
以上恢復方法只針對非空的文件,RHEL7的xfs是能夠將空文件恢復