在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%,尤其是在数据被覆盖或删除后。因此,为了避免数据丢失,建议定期备份重要数据。