CentOS 系統本身并沒有回收站這一概念,因為它是基于 Linux 的開源操作系統,而回收站是 Windows 系統的特性。在 CentOS 中,刪除的文件通常不會移動到“回收站”或“廢紙簍”,而是直接從文件系統中移除。因此,CentOS 回收站刪除的文件不能通過常規手段找回。
使用extundelete工具恢復ext4文件系統中的文件:
sudo yum install e2fsprogs-devel gcc gcc-cwget 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
/usr/local/extundelete/bin/extundelete /dev/sdXY --restore-all
/usr/local/extundelete/bin/extundelete /dev/sdXY --restore-directory /path/to/deleted/directory
/usr/local/extundelete/bin/extundelete /dev/sdXY --restore-file /path/to/deleted/file
使用TestDisk工具恢復其他文件系統中的文件:
sudo yum install testdisk
請注意,數據恢復的成功率受多種因素影響,包括數據被刪除和覆蓋的時間、硬盤的使用情況等。因此,為了避免數據丟失,建議定期備份重要文件。