1. If TestDisk is not yet installed, it can be downloaded from TestDisk Download. Extract the files from the archive including the sub-directories.
2. To recover a lost partition or repair the filesystem from a hard
disk, USB key, Smart Card, etc., you need enough rights to access a
- Under DOS, run TestDisk.exe
Under Windows, start TestDisk (ie testdisk-6.9/win/testdisk_win.exe)
from an account in the Administrator group. Under Vista, right-click
testdisk_win.exe and then "Run as administrator" to launch TestDisk.
- Under Unix/Linux/BSD, you need to be root to run TestDisk (ie. sudo testdisk-6.9/linux/testdisk_static)
Under MacOSX, if you are not root, TestDisk (ie
testdisk-6.9/darwin/TestDisk) will restart itself using sudo after
confirmation on your part.
- Under OS/2, TestDisk doesn't handle a physical device, only a disk image. Sorry.
3. To recover partition from a media image or repair a filesystem image, run:
- testdisk image.dd to create a raw disk image
- testdisk image.E01 to recover files from an Encase EWF image
- testdisk 'image.???' if the Encase image is split into several files.
To repair a filesystem not listed by TestDisk, run testdisk device, i.e.
- testdisk /dev/mapper/truecrypt0 or testdisk /dev/loop0
to repair the NTFS or FAT32 boot sector files from a TrueCrypt
partition. The same method works with filesystem encrypted with
- testdisk /dev/md0 to repair a filesystem on top of a Linux RAID device.
5. Choose Create to instruct Testdisk to create a log file
containing technical information and messages, unless you have a reason to append data to the log
or you execute TestDisk from read only media and must create the log
6. Choose None if you do not want messages and details of the process to be written into a log file
(useful if for example Testdisk was started from a read-only location).
7. Press Enter to proceed.
8. All hard drives should be detected and listed with the correct size by TestDisk:
- Use up/down arrow keys to select your hard drive with the lost partition/s.
- Press Enter to Proceed.
If available, use raw device /dev/rdisk* instead of /dev/disk* for faster data transfer.
9. TestDisk displays the partition table types:
- Select the partition table type - usually the default value is
the correct one as TestDisk auto-detects the partition table type.
- Press Enter to Proceed.
10. TestDisk displays the menus:
- Use the default menu "Analyse" to check your current partition structure and search for lost partitions.
- Confirm at Analyse with Enter to proceed.
11. Now, your current partition structure is listed.
Examine your current partition structure for missing partitions and errors:
- The first partition is listed twice which points to a corrupted partition or an invalid partition table entry.
- Invalid NTFS boot points to a faulty NTFS boot sector, so it's a corrupted filesystem.
- Only one logical partition (label Partition 2) is available in the extended partition.
One logical partition is missing.
12. Confirm at Quick Search
- Confirm according to your OS and created partitions to proceed.
13. During the Quick Search
, TestDisk has found two partitions including the missing logical partition labeled Partition 3
- Highlight this partition and press p to list your files (to go back to the previous display, press q to Quit).
- If all directories and data are correctly listed, Press Enter to proceed.
14. Save the partition table or search for more partitions?
- When all partitions are available and data correctly listed, you should go to the menu Write to save the partition structure. The menu Extd Part
gives you the opportunity to decide if the extended partition will use
all available disk space or only the required (minimal) space.
- If you are still missing a partition, highlight the menu Deeper Search (if not done automatically already) and press Enter to proceed.