Testdisk & PhotoRec: One of the most powerful data/partition recovery duo you will ever use

I remember long ago, in my Linux phase, I used to mess up my Windows partition about twice a day (don’t ask me how… it just happened). Back then, I discovered Testdisk and used it to recover/boot my Windows partition when I had problems (it was usually very successful). Since then I have moved on from Linux and forgotten all about Testdisk; yet the lingering memory of the program still remained in my memory and whenever I wanted to write about Testdisk, I just couldn’t think of the darn name. Well, recently a couple of people have been recommending I check out PhotoRec, and in the process I rediscovered Testdisk. Turns out Testdisk and PhotoRec are companion programs that are from the same developer, come in the same download, and both are probably the most powerful programs in their specific class.

Testdisk

2009-10-11_105312

Testdisk is an open source, command line utility designed to help you either recover deleted partitions, or to boot non-bootable partitions. TestDisk can

  • Fix partition table, recover deleted partition
  • Recover FAT32 boot sector from its backup
  • Rebuild FAT12/FAT16/FAT32 boot sector
  • Fix FAT tables
  • Rebuild NTFS boot sector
  • Recover NTFS boot sector from its backup
  • Fix MFT using MFT mirror
  • Locate ext2/ext3 Backup SuperBlock
  • Undelete files from FAT, NTFS and ext2 filesystem
  • Copy files from deleted FAT, NTFS and ext2/ext3 partitions.

The great thing about Testdisk is it actually works; it finds undeleted partition at a much higher recovery rate than any other partition recovery software I used yet (note, however, you will need to do the “dig deeper” option to find more partitions; the normal scan is not the best). The downside, obviously, to Testdisk is it is a command line utility with no GUI (Graphical User Interface). Well, to say it is command line is a lie; you actually do not have to physically type in any commands to use Testdisk. Rather you just select the options from the menu it gives you…

2009-10-11_105337

2009-10-11_105343

2009-10-11_105355

2009-10-11_115111

2009-10-11_115636

…and so on, so forth. Testdisk is actually very easy, and well worth the effort put into learning how to use it, so don’t let the lack of a GUI deter you.

Of course partition recovery and boot fixing is something better done outside of Windows rather than inside Windows, so there are ways to run Testdisk from a bootable CD; or you can always download a live CD which comes with Testdisk on it.

PhotoRec

PhotoRec is going to be of more interest to more people than Testdisk. PhotoRec is a software that specializes in data recovery, as opposed to partition recovery of Testdisk. PhotoRec works on hard drives, CDs, external media (memory cards, USB/flash drives, etc.). While PhotoRec also lacks a GUI, just like Testdisk, it is also fairly easy to use if you look past the big, bad, command prompt:

2009-10-11_114848

2009-10-11_114922

2009-10-11_102857

2009-10-11_102913

2009-10-11_102924

2009-10-11_103042

2009-10-11_104245

While PhotoRec is not the fastest data recovery program I have used (it is also not that slow; it took just over 12 minutes to recover data from a ~5GB partition), the recovery rate of PhotoRec is the best I have ever seen. It successfully recovered thousands of files for me  (yes, it is even more powerful than DiskDigger) – and it recovers many, many different types of files, including by not limited to images, movies, documents, and executables.

One of the big reasons why PhotoRec has such as great recovery rate is it ignores the file system of the partition you are scanning; on the other hand the problem with ignoring the file system is it does not recover file names for you. Another problem with PhotoRec is it is an all or nothing; it does not allow you to pick and chose which files you want to recover – it recovers them all (even malware files so be careful). You can, though, mitigate how many files PhotoRec recovers by designating PhotoRec to only look for files of a specific format:

2009-10-11_104938

Since PhotoRec recovers all files instead of allowing you to select only certain ones, PhotoRec is not for every day usage. Rather, it is for “doomsday” when you have a critical technical malfunction, lose everything, and need to recover extremely important data.

Take note Testdisk & PhotoRec come as one download and to run them you need to look in the “win” folder that you unzip the .ZIP you download.

Overall, I highly recommend Testdisk & PhotoRec to anyone that can make use of the services they provide. Both are definitely one of the best you will ever find in their class; and since they are both free, you have nothing to lose and everything to gain by giving them a try [when you need them]. You can download Testdisk & PhotoRec from the following links:

Version reviewed: 6.11.3

Supported OS:

  • DOS/Win9x
  • Windows
  • Linux
  • FreeBSD, NetBSD, OpenBSD
  • SunOS
  • MacOS

Testdisk & PhotoRec homepage [direct download (for Windows version)]

Share this post

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

17 comments

  1. KillNoise

    1. Calling TestDisk & PhotoRec “CLI applications” is misleading. These applications guide you well through the process & options, so “Text Menu Wizard” would be more precise – and much less scaring!

    2. I share your enthusiasm for TestDisk, but not so much for PhotoRec:
    Using its Raw Deep-Scan approach will typically leave you with a vast amount of copied files, of which you not even know the proper filenames !
    How to find the files you really need ?

    Moreover:
    Never trust any files where recovered properly under the common assumption of consecutive cluster allocation: Unless you collected files without deleting anything (such as starting a photo-safari with an empty memory card), disk fragmentation renders most of the larger files useless after recovery, even if the file header may seem promising. So you have to examine carefully what you have got – preview would be helpful.

    And what about compressed & encrypted files on NTFS volumes ?
    I doubt recovery programs can handle them properly, unless explicitly featured.
    (e.g. Mitusoft Aidfile Recovery or EaseUS Data Recovery Wizard claim to do so)

    Conclusion:
    Using the Raw Deep-Scan by PhotoRec might be your last attempt to recover data after having tried other recovery applications, able to exploit directory & allocation information still available if the filesystem is known.

    @ Ashraf: You should include this note here with a reference to your excellent article
    http://dottech.org/113185/windows-review-best-free-file-data-recovery-programs

  2. Louis

    Good idea to do this Ashraf, I’ve been considering just the other day which I should get, since I’ve restored my whole system back to its ‘virgin state’ and rebuilt it from scratch to get it’s speed back to normal (I think I saw a piece of software advertised on gaotd, but didn’t bite).

    Heheh This reminds me of the old Norton Ghost interface of a decade or so ago, before it got its current GUI, as many similar programs now also have

    — back in the day, that was just about the only program to use, and you had better made sure you picked the right drive to resurrect, which meant you had to write down the exact size of the partition, since the command line didn’t specify the drive letter

    hehe those were the days. But seriously, I imagine you’re going to be testing some software who does have GUI’s etc, and see how they really stack up against this software ?

    I’d like to know if there’s any open source / freeware that essentially can get the same results as these software (there seem so many, and every freeware package claim to have one).

    I’ll watch the final choice with lots of interest !

  3. Gary Sellars

    [@Nebulous]

    I’m sorry, but I can’t help you with this, but if Sony has in fact made their recorder invisible to your GUI, that is so SELF-SERVING I’d write Sony a letter and tell them I’m through with their products. I’ve owned a lot of Sony products and they do a lot of things to keep squeezing money out of people.

  4. Nebulous

    I have a question for a technical user. I’m not interested in further cluttering my system with programs unless they will help me, so I thought I’d see what you advise. I’m fairly technical myself, but I need another opinion.

    Yesterday I accidentally deleted a recording on my digital voice recorder, which is of the Sony ICD-PX series. It’s not currently available to me and I don’t remember the exact model.

    I need a way to recover that recording. It is very important to me. I chatted with Sony support and they said I should pay their data recovery team something like $100 plus $20 return shipping to do it for me.

    The problem is, the recorder does not show up as a drive in Windows. It’s not made that way. It connects by USB, but only Sony’s software sees it. Recordings are stored as MP3s.

    So, can a program like Testdisk or PhotoRec – or any other type – recover files from devices that don’t register themselves as drives? Any recourse for me?

    Thanks!

    ~N

  5. JC

    Used both these this week on two drives – one with a missing partition table (testdisk) and one which had been formatted with a laptop recovery disk (photorec)

    Both worked amazingly – better than any commercial offerings.

  6. Adrian

    Everyone:

    This is a general notice. Would anyone who knows programming make a GUI for this prog? Yes it’s great, but most people would just shut up and escape when they see command line. Anyways, just a simple two lines of C++ or Pascal could make it scan for the file system and decide on itself.

  7. Ozzie

    Brilliant! Thanks Ashraf! About a year or so ago I crashed my laptop badly (is it ever goodly?) and was unable (through a complete lack of knowledge and a post-crash panic in which I mucked around where I shouldn’t have) to retrieve anything. At the time, I had spent three weeks researching and writing up information for an environmental website that a big org was setting up – and the horror of the extent of the calamity when I lost all that work was beyond belief. I never, ever want to have to go through that again. So this is perfect. On behalf of people like me (who are known to cause inconceivable and previously unheard of damage to comps), I thank you from the bottom of my heart. :)

  8. Ron

    Found these two about a year ago when an external drive partitioned into three drives got corrupted on the first partition. Windows refused to see the external drive. I used PhotoRec to recover images and TestDisk to repair the first partition temporarily. I was able to determine if I had other backups (I did) before taking the faulty drive out of service for good. Highly recommended; terrific review, Ashraf.

  9. WECH

    Indeed testdisk is excellent rescuer, I was once has legacy FAT (W95) HDD that near breakdown, I wanted connect as USB and just copy whatever I can, but WinXP says the drive is not initialized, I should have known better, after that initialization, it just appear as bare drive, and the cranking box no long able to boot the drive, the testdisk got it back!

  10. Kendp

    I get an error notice saying it can’t start because cygwin.dll can’t be found. Seems to be in the folder with recphoto.exe, but I still get the error notice. I had tried to download this program from the website previously but had the same problem.

  11. Jyo

    Thanks for this awesome and informative article Ashraf! Testdisk will definitely come in handy for me, as I have experienced turning on my pc only to discover the boot sector is corrupted just 4 years ago.