1.安装依赖包(e2fsprogs,e2fsprogs-libs,e2fsprogs-devel)
# yum -y install e2fsprogs*
2.下载并安装extundelete-0.2.4.tar.bz2
# wget http://nchc.dl.sourceforge.net/project/extundelete/extundelete/0.2.4/extundelete-0.2.4.tar.bz2
# tar -jxvf extundelete-0.2.4.tar.bz2
# cd extundelete-0.2.4
# ./configure --prefix=/usr/local/extundelete
# make && make install
3.验证是否安装成功
# cd /usr/local/extundelete/bin
# ./extundelete -v
----------------------------------------------------------------------
extundelete version 0.2.4
libext2fs version 1.41.12
Processor is little endian.
----------------------------------------------------------------------
4.设置环境变量
# echo "PATH=/usr/local/extundelete/bin:$PATH" >> /etc/profile
# echo "export PATH" >> /etc/profile
# source /etc/profile
5.使用一个新磁盘分区做测试
# mount /dev/sdb1 /mnt
# cp /etc/grub.conf ./
# rm -rf ./*
# cd /data
# umount /mnt
6.查看被删除的文件
# extundelete /dev/sdb1 --inode 2
7.一次性恢复所有文件
# extundelete /dev/sdb1 --restore-all
8.查看文件是否恢复成功(默认被删文件会恢复到当前目录下的RECOVERED_FILES目录中去)
# ls -al /data/RECOVERED_FILES/
PS:其他的参数可以自己去 extundelete --help 查看。。。。。
本文出自 “珞辰的博客” 博客,请务必保留此出处http://luochen2015.blog.51cto.com/9772274/1742081
原文地址:http://luochen2015.blog.51cto.com/9772274/1742081