2. Installation

2.1. Linux: Installation of distribution package

2.1.1. Arch Linux

TestDisk is available in the Extra repo from Arch Linux. As root,

pacman -S testdisk

2.1.2. CentOS

TestDisk and QPhotoRec are available in the EPEL repository for CentOS. As root,

yum install epel-release
yum install testdisk qphotorec

If epel repository is disabled on your CentOS, use

yum install --enablerepo=epel testdisk qphotorec

2.1.3. ClearLinux

To install TestDisk bundle on ClearLinux, run

sudo swupd bundle-add testdisk

2.1.4. Debian

TestDisk is available for Debian.

As root,

apt update
apt install testdisk

2.1.5. Fedora

TestDisk is available for Fedora.

As root,

dnf install testdisk qphotorec

2.1.6. Fedora Copr

Copr is an automatic build system for Fedora. It provide the latest development version. As root,

dnf copr enable grenier/testdisk
dnf install testdisk qphotorec

2.1.7. Gentoo

TestDisk is available on Gentoo.

sudo emerge --ask app-admin/testdisk

2.1.8. openSUSE

zypper refresh
zypper install testdisk photorec qphotorec

2.1.9. Ubuntu

As root on the Ubuntu system,

apt update
apt install testdisk

2.2. macOS: Installation via Homebrew

Install brew from https://brew.sh if you haven’t do so:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Then, install testdisk

brew install testdisk

2.3. Official binaries

2.3.1. Official binaries: stable or WIP ?

Using the development version (WIP=Work In Progress) is usually recommended as fixes are not backported. The WIP archive may be modified several times per week but keep the same name. If this version doesn’t start, you can always use the stable version and warn the developer of the problem with the beta version.

2.3.2. Installation of official binaries for Windows

2.3.3. Installation of official binaries for macOS

Download the archive from https://www.cgsecurity.org/wiki/TestDisk_Download

  • macOS / Mac OS X Intel / OS X 64-bit (macOS >= 10.6)

  • macOS / Mac OS X Intel / OS X 32-bit (macOS <= 10.14)

  • Mac OS X PowerPC for very old Mac (macOS <= 10.5)

Extract all the files including the subdirectories

2.3.4. Installation of official binaries for Linux

Download the archive from https://www.cgsecurity.org/wiki/TestDisk_Download Currently we have

The archives contains static binaries for Intel (x86_64 or i686) platforms. They should work as-is on any recent Linux distribution.

Decompress the archive, no need to be root

tar xjf testdisk-7.2-WIP.linux26-x86_64.tar.bz2

List your files (ls), a directory named testdisk-7.2-WIP should has been created in the current working directory.

Warning

The ready-to-use Linux binaries may not list correctly filenames from NTFS or exFAT filesystems. These binaries provided on cgsecurity.org are static binaries. Unfortunately, the GNU C Library’s iconv implementation uses shared loadable modules to implement the Unicode conversions. iconv support need to be disabled otherwise the binaries will crash if the local glibc version don’t match the glibc version used when compiling.