TestDisk Step By Step

This recovery example guides you through TestDisk step by step to recover a missing partition and repair a corrupted one. After reading this tutorial, you should be ready to recover your own data. Translations of this TestDisk manual to other languages are welcome.

Example problem

We have a 36GB hard disk containing 3 partitions. Unfortunately;

  • the boot sector of the primary NTFS partition has been damaged, and
  • a logical NTFS partition has been accidentally deleted.
  • This recovery example guides you through TestDisk, step by step, to recover these 'lost' partitions by:

  • rewriting the corrupted NTFS boot sector, and
  • recovering the accidentally deleted logical NTFS partition.
  • Recovery of a FAT32 partition (instead of an NTFS partition) can be accomplished by following exactly the same steps. Other recovery examples are also available. For Information about FAT12, FAT16, ext2/ext3, HFS+, ReiserFS and other partition types, read Running the TestDisk Program.

  • TestDisk must be executed with Administrator privileges.
  • To navigate in TestDisk, use the Arrow and PageUp/PageDown keys.
  • To proceed, confirm your choice(s) with the Enter key.
  • To return to a previous display or quit TestDisk, use the q (Quit) key.
  • To save modifications under TestDisk, you must confirm them with the y (Yes) and/or Enter keys, and
  • To actually write partition data to the MBR, you must choose the "Write" selection and press the Enter key.
  • Symptoms

    If this hard disk's primary partition contained an operating system, it would most likely no longer boot up - due to its corrupted boot sector. If the hard disk was a secondary (data) drive or you can connect the drive to another computer in its secondary channel (usually where a CD/DVD drive is connected), the following symptoms would be observed:

  • Windows Explorer or Disk Manager displays the first primary partition as raw (unformatted) and Windows prompts: The drive is not formatted, do you want to format it now?[You should never do so without knowing why!]
  • A logical partition is missing. In Windows Explorer, that logical drive is no longer available. The Windows Disk Management Console now displays only "unallocated space" where this logical partition had been located.
  • Running TestDisk executable

    If TestDisk is not yet installed, it can be downloaded from TestDisk Download. Extract the files from the archive including the sub-directories.

    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 physical device.

  • 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, ... Read more