前置作業:
1. 安裝 testdisk 套件
sudo apt-get install testdisk (Ubuntu)
sudo yum install testdisk (Fedora)
sudo zypper install testdisk (OpenSuSE)
2. 插入裝置 (USB 隨身碟、讀卡機 / CF Card / SD Card...)
若系統自動掛載裝置, 應立即卸載 (umount) 避免寫入資料而損及待救回的檔案
救回誤刪檔案
sudo testdisk
Use arrow keys to select, then press Enter key: |
[ Create ] Create a new log file |
[ Append ] Append information to log file |
[ No Log ] Don't record anything |
↑ 選擇 [ No Log ]
Select a media (use Arrow keys, then press Enter): |
Disk /dev/sda - 4001 MB / 3815 MiB - ATA SILICONMOTION SM |
Disk /dev/sdc - 66 MB / 63 MiB - PQI ATA Rev6.0 |
↑ 選擇 Disk /dev/sdc (插入的裝置)
裝置名稱因環境會有所不同
Disk /dev/sdc - 66 MB / 63 MiB - PQI ATA Rev6.0 |
Please select the partition table type, press Enter when done. |
[Intel ] Intel/PC partition |
[EFI GPT] EFI GPT partition map (Mac i386, some x86_64...) |
[Mac ] Apple partition map |
[None ] Non partitioned media |
[Sun ] Sun Solaris partition |
[Return ] Return to disk selection |
↑ 選擇 [ Intel ]
Disk /dev/sdc - 66 MB / 63 MiB - CHS 1010 16 8 |
[ Analyse ] Analyse current partition structure and search for lost partitions |
[ Advanced ] Filesystem Utils |
[ Geometry ] Change disk geometry |
[ Options ] Modify options |
[ MBR Code ] Write TestDisk MBR code to first sector |
[ Delete ] Delete all data in the partition table |
[ Quit ] Return to disk selection |
↑ 選擇 [ Advanced ]
Disk /dev/sdc - 66 MB / 63 MiB - CHS 1010 16 8 |
Partition Start End Size in sectors |
1 * FAT16 >32M 0 1 1 1008 15 8 129144 [NO NAME] |
[ Type ] [ Boot ] [Image Creation] [Undelete] [ Quit ] |
↑ 按上、下鍵選擇目標分割區 (本例只有一個分割區)
按左、右鍵移動光棒, 選擇 [ Undelete ]
1 * FAT16 >32M 0 1 1 1008 15 8 129144 [NO NAME] |
-rwxr-xr-x 0 0 512 1-Jan-2002 00:00 NIKON001.DSC |
drwxr-xr-x 0 0 0 1-Jan-2002 00:00 MISC |
drwxr-xr-x 0 0 0 1-Jan-2002 00:00 DCIM |
↑ 移動光棒探索目錄, 若有可救回的檔案會以紅色呈現
在欲救回的檔案上按 c, 接著可選擇救出後的檔案存放位置, 預設為家目錄, 按 y 可將檔案從外接裝置複製到本機
連按數次 q 結束 testdisk (或直接 Ctrl + C 中斷執行)
-
救回被相機格式化前的照片
sudo photorec
Select a media (use Arrow keys, then press Enter): |
Disk /dev/sda - 4001 MB / 3815 MiB - ATA SILICONMOTION SM |
Disk /dev/sdc - 66 MB / 63 MiB - PQI ATA Rev6.0 |
↑ 選擇 Disk /dev/sdc (插入的裝置)
裝置名稱因環境會有所不同
Disk /dev/sdc - 66 MB / 63 MiB - PQI ATA Rev6.0 |
Please select the partition table type, press Enter when done. |
[Intel ] Intel/PC partition |
[EFI GPT] EFI GPT partition map (Mac i386, some x86_64...) |
[Mac ] Apple partition map |
[None ] Non partitioned media |
[Sun ] Sun Solaris partition |
[Return ] Return to disk selection |
↑ 選擇 [ Intel ]
Disk /dev/sdc - 66 MB / 63 MiB (RO) - PQI ATA Rev6.0 |
Partition Start End Size in sectors |
No partition 0 0 1 1010 0 1 129281 [Whole disk] |
1 * FAT16 >32M 0 1 1 1008 15 8 129144 [NO NAME] |
[ Search ] [Options ] [File Opt] [ Quit ] |
↑ 按上、下鍵選擇目標分割區 (本例只有一個分割區)
按左、右鍵移動光棒, 選擇 [ Search ]
1 * FAT16 >32M 0 1 1 1008 15 8 129144 [NO NAME] |
To recover lost files, PhotoRec need to know the filesystem type where the |
[ ext2/ext3 ] ext2/ext3/ext4 filesystem |
[ Other ] FAT/NTFS/HFS+/ReiserFS/... |
↑ 選擇 [ Other ]
1 * FAT16 >32M 0 1 1 1008 15 8 129144 [NO NAME] |
Please choose if all space need to be analysed: |
[ Free ] Scan for files from FAT16 unallocated space only |
[ Whole ] Extract files from whole partition |
↑ 選擇 [ Whole ] 對整個分割區進行掃描
亦可選擇 [ Free ] 只掃描未使用的空間
接著可選擇救出後的檔案存放位置, 預設為家目錄, 按 y 開始掃描、救出檔案
-
後記: testdisk、photorec 也可以救回一般硬碟的資料, 不過因為硬碟資料、目錄通常很多, 用 testdisk 會找檔案找得很累, 用 photorec 可能會救出一堆陳年資料. 不管如何, testdisk 的確是一套簡單易用的檔案救援工具.
http://cha.homeip.net/blog/2010/07/2520.html
沒有留言:
發佈留言