A while ago I wrote an article on How to Recover a Disk Partition with TestDisk and GParted Live. While TestDisk is a powerful tool for recovering lost partitions, when the aim is to just recover the individual files, there is a separate dedicated application bundled with TestDisk, named PhotoRec, which is more suitable for this kind of work.

PhotoRec is free and open source, just like TestDisk, and is pretty much compatible with all popular operating systems (yup, MS-DOS too!). Furthermore, even though its name might suggest otherwise, it can find and recover any type of files — not just photos.

PhotoRec

Head over to the download page and pick the version corresponding to your operating system. If you are a Windows user, you most probably want Windows 64-bit. If you are on Linux, there are good chances that TestDisk/PhotoRec is already included in your distribution’s repositories (try apt-cache policy testdisk or equivalent).

The application is portable, which means that after you extract the files, you can use it immediately — no installation is required.

Recovering files

For this tutorial, I copied a bunch of jpeg files into a USB disk, and then deleted them. Based on my past experience with PhotoRec, even if you (fast) format, or partially overwrite your disk, PhotoRec should still be able to recover some, or all of your files intact.

Follow the steps below to recover your files: