linux系统误删数据恢复方法
1.安装恢复数据软件extundelete:yum安装:yum install epel-release -yyum install extundelete -y源码安装:yum install epel-release vim wget gcc gcc-c++ -yyum -y install e2fsprogs*wget https://nchc.dl.sourceforge.n...
1.安装恢复数据软件extundelete:
yum安装:
yum install epel-release -y
yum install extundelete -y
源码安装:
yum install epel-release vim wget gcc gcc-c++ -y
yum -y install e2fsprogs*
wget https://nchc.dl.sourceforge.net/project/extundelete/extundelete/0.2.4/extundelete-0.2.4.tar.bz2
tar xf extundelete-0.2.4.tar.bz2
cd extundelete-0.2.4
./configure
make && make install
2.模拟删除数据:
cd /tmp
rm -rf ./*
mkdir a b c
touch 1.txt
touch a/a.txt b/b.txt c/c.txt
echo “this is 1.txt,shuju huifu ceshi wenjian!” >1.txt
echo “this is a.txt,shuju huifu ceshi wenjian!” >a/a.txt
echo “this is b.txt,shuju huifu ceshi wenjian!” >b/b.txt
echo “this is c.txt,shuju huifu ceshi wenjian!” >c/c.txt
rm -rf ./*
3.恢复:
如果分区可以挂载成只读的话最好挂载成只读模式,以免磁盘被覆盖
mount -o remount,ro /home
extundelete /dev/sda5 --inode 2
extundelete /dev/sda5 --restore-directory abc3
会在当前目录下生成RECOVERED_FILES目录,在RECOVERED_FILES目录下就会有我们恢复的abc3目录文件
extundelete /dev/sda5 --restore-file hello.txt 恢复文件
extundelete /dev/sda5 --restore-all 恢复所有被删除的文件
这个工具恢复的数据也不一定完整,也只是恢复部分数据,恢复全部数据的可能性很小。
更多推荐
所有评论(0)