下面以一張SD卡為例,裡頭放了一些doc pdf avi jpg等檔案,我把所有檔案都移除清空
1.foremost
sudo apt-get install foremost
先檢查該SD卡的設備檔位置,執行 mount
mount
..........
.........
/dev/mmcblk0p1 on /media/SD CARD type vfat (rw,nosuid,nodev,uhelper=devkit,uid=1000,gid=1001,shortname=mixed,dmask=0077,utf8=1,flush)
可以發現該SD卡使用的設備檔是/dev/mmcblk0p1
救援指令
sudo foremost -t all -i /dev/mmcblk0p1 -o 救援檔
完成後,就會在『救援檔』目錄下產生各格式的目錄,裡頭就有救回的檔案

pdf檔成功救回

2.testdisk
下載:http://www.cgsecurity.org/wiki/TestDisk_Download
下載
救援指令
sudo /opt/testdisk-6.11.3/linux/photorec_static
選擇要救援的磁碟

選擇所用的分割區模式,通常是Intel

選擇分割區

選擇檔案系統格式,此處是fat

救援模式

救援檔案要放置的位置,選好後起按y

檔案救回成功

3.比較
以上兩個工具都能有效救回失去的檔案,不過救援能力各有不同,像是testdisk幫我多救回一張圖片與avi影片,但foremost卻又幫我找回了一個zip檔(不知是何時存的,已不可考),所以說孰優孰劣勢無法比的,交互使用救援會更齊全吧!
沒有留言:
張貼留言