在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
请注意,数据恢复并不是百分之百成功的,尤其是当文件被删除后,磁盘被写入了新的数据。因此,采取及时的措施和使用合适的工具至关重要。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:CentOS回收站文件误删怎么恢复