TestDisk is a complete and universal disk recovery solution for all platforms and all file systems. In addition to this it is free open source project. Open source is licensed under the terms of the GNU General Public License (GPL). TestDisk can fix and recover partition tables, recover or rebuild boot sectors, fix FAT tables, undelete files, and recover files from deleted partitions. The list of file systems supported by TestDisk is long. It supports all Windows, MAC OS and Linux standard partitions including software RAID arrays created with the mdadm tool. Of course, TestDisk can run under all popular operating systems including DOS, FreeBSD, NetBSD, OpenBSD, and SunOS.
TestDisk can help if you have a working hard drive. The file system may be corrupted but the drive must be accessible under operating system.
TestDisk is command line software and needs no installation. To run it you have to download the archive and extract all the files in a folder. To recover data TestDisk must be run with administrator (root) privileges. In Windows version of the TestDisk disks are named like Linux device names for SCSI disks /dev/sdX. This comes from the internal disk mappings of the compiler used to compile TestDisk. Each operating system has some limitations or special properties. These can be found on the OS Notes page.
Working with TestDisk is simple. All possible options are displayed in the menu. You can use arrow keys to change selected function, enter key for selection or confirmation and q to cancel or return to previous menu. Initially TestDisk displays found disks. You choose one and proceed to partition table options. Here you can analyze and repair partitions or recover boot sectors.
TestDisk select disk menu
Here is another example of how TestDisk displays partition data of a 160 GB hard drive under Windows:
TestDisk 6.11.3, Data Recovery Utility, May 2009
Disk /dev/sda – 160 GB / 149 GiB – CHS 19457 255 63
Current partition structure:
Partition Start End Size in sectors
1 * HPFS – NTFS 0 1 1 5098 254 63 81915372 [SYSTEM XP]
2 P HPFS – NTFS 5099 0 1 19456 254 63 230661270 [Data]
*=Primary bootable P=Primary L=Logical E=Extended D=Deleted
[Quick Search] [ Backup ]
Try to locate partition
Once the partitions are back you can proceed to individual file recovery. Select Advanced (Filesystem utilities) in the partition menu and chose the partition where you would like to undelete files. You will get a list of deleted files and folders (in FAT and Linux partitions they are displayed in red color). Chose a file that needs to be undeleted and press c. The software asks you for a destination folder and saves the file there.
TestDisk can repair typical problems in corrupted file systems. It can also recover deleted files if the disk space was not overwritten with other data. To scan disk for other lost files regardless of file system you can use PhotoRec software from the same author which scans the disk and searches for header signatures of common file types.
- Free and open source
- Needs no installation
- Runs under most operating systems
- Supports most popular file systems
- Text based command line utility