在CentOS系統中,回收站通常被稱為“廢紙簍”,其文件恢復步驟如下:
yum install e2fsprogs*
wget 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/sdb --inode 2
/usr/local/extundelete/bin/extundelete /dev/sdb --restore-file test.txt
/usr/local/extundelete/bin/extundelete /dev/sdb --restore-all
恢復的文件通常會被保存到當前目錄下的 RECOVERED_FILES/
目錄中。
sudo yum install testdisk
testdisk
請注意,數據恢復的成功率取決于文件被刪除后磁盤是否被新的數據覆蓋。因此,一旦發現文件丟失,應盡快嘗試恢復操作。此外,建議定期備份重要數據,以防數據丟失。