在CentOS系统上使用extundelete
工具进行数据恢复的步骤如下:
yum install e2fsprogs* -y
wget http://nchc.dl.sourceforge.net/p/extundelete/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
cd /usr/local/extundelete/bin
./extundelete -v
停止对分区的所有写操作:
卸载分区:
umount /dev/sdb2
执行数据恢复:
使用extundelete
恢复文件或整个分区。
恢复单个文件:
/usr/local/extundelete/bin/extundelete --restore-file 1.txt /dev/sdb2
恢复整个分区:
/usr/local/extundelete/bin/extundelete --restore-all /dev/sdb2
恢复的文件会放在当前目录下的RECOVERED_FILES/
目录中。
检查恢复的文件:
ls ./RECOVERED_FILES/
重新挂载分区:
以上步骤和注意事项是基于一般情况下的数据恢复流程,具体情况可能因数据存储方式、文件系统类型以及误操作的具体情况而有所不同。在执行数据恢复之前,建议详细阅读extundelete
的官方文档,并根据实际需求调整恢复策略。