在CentOS系统中,如果误删了文件,可以尝试以下几种方法进行恢复:
yum install e2fsprogs* -y
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
/usr/local/extundelete/bin/extundelete /dev/sdb2 --restore-file 1.txt
恢复的文件会保存在当前目录下的RECOVERED_FILES/
目录中。/usr/local/extundelete/bin/extundelete /dev/sdb2 --restore-all
恢复的文件同样保存在RECOVERED_FILES/
目录中。sudo yum install testdisk
请注意,数据恢复并不是百分之百成功的,尤其是当文件被删除后,磁盘被写入了新的数据。因此,采取及时的措施和使用合适的工具至关重要。