在Debian系統中,恢復誤刪文件可以通過多種數據恢復工具來實現。以下是一些常用的方法和步驟:
foremost 恢復文件sudo apt install foremost
echo "this is an important file" > important.txt
sudo rm /home/user/documents/important.txt
sudo foremost -t all -i /dev/sda1 -o /tmp/recovered_files
ls /tmp/recovered_files
extundelete 恢復文件sudo apt install e2fsprogs-devel
wget https://src.fedoraproject.org/repo/pkgs/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 && sudo make install
echo "this is an important file" > important.txt
sudo rm /home/user/documents/important.txt
sudo /usr/local/extundelete/bin/extundelete /dev/sda1 --restore-all
ls RECOVERED_FILES
ext3grep 恢復文件sudo apt install ext3grep
cd /mnt/TEST_DRIVE
sudo touch files[1-5]
ls -l
sudo rm file5
sudo umount /mnt/TEST_DRIVE
ext3grep --restore-all /dev/sdb1
cd RESTORED_FILES
ls
testdisk 和 photorec 恢復文件sudo apt get update
sudo apt get install testdisk
sudo testdisk
sudo apt get update
sudo apt get install photorec
sudo photorec /dev/sda1
請注意,數據恢復的成功率并不是100%,尤其是在數據被覆蓋或刪除后。因此,為了避免數據丟失,建議定期備份重要數據。