Skip to main content
data-recovery-headCOMP

TestDisk vs PhotoRec 2026: Which One Should You Use? (Complete Guide)

TestDisk or PhotoRec for data recovery? Full 2026 comparison: use cases, step-by-step walkthrough, 10-criteria table, and profile-based recommendations.

By Eric Gerard · Éditeur · Save My Disk8 min readPhoto via Unsplash

Note: TestDisk (partition recovery) and PhotoRec (signature-based file carving) are the two free reference tools from CGSecurity. This guide focuses on when to use each and how, based on their documented capabilities and real-world use — not a Wikipedia summary.

TestDisk and PhotoRec are the two reference open-source tools for data recovery. Free, powerful, and intimidating for beginners. But they don't do the same thing — and picking the wrong one at the wrong time can cost you hours or make the situation worse.

This guide cuts through: which tool, for which case, with concrete steps.

30-Second Verdict: Which Tool to Use?

SituationRecommended Tool
Corrupted or missing partition tableTestDisk
Inaccessible logical partition (RAW, corrupted FS)TestDisk
Fully formatted drive, table unrecoverable, need photos/docsPhotoRec
Fast file recovery by type (JPG, PDF…)PhotoRec
Need file names and directory structure preservedTestDisk (P listing) or EaseUS
Non-technical user, no CLI experienceEaseUS Data Recovery Wizard

In short:

  • TestDisk: the most powerful tool for structures (partition tables, boot sectors), but with the steepest learning curve.
  • PhotoRec: unbeatable for file carving by file type, at the cost of lost names and directory structure.
  • EaseUS Data Recovery Wizard: the most accessible for non-technical users (graphical interface, file preview, free tier up to 2 GB).

These two tools are complementary rather than competing. The real question isn't "which is better" but "which one matches my problem."

TestDisk: The Tool That Repairs Structures

History and Mission

TestDisk was born in 1998 in the mind of Christophe Grenier, a French independent developer. Version 1.0 was released in 2002, and version 7.2 (the latest, with ARM64 Mac support) arrived in 2024. The project is hosted at cgsecurity.org and distributed under GPL v2.

TestDisk's mission is precise: reconstruct and repair low-level structures (partition tables, boot sectors, file systems). It does not perform file carving.

Key Strengths

  • Partition tables: full MBR (MS-DOS) and GPT reconstruction
  • File systems: NTFS, FAT12/16/32, exFAT, ext2/3/4, HFS+, APFS (partial), UFS, Linux RAID
  • Boot sector repair: Windows MBR repair, NTFS boot sector restoration
  • File listing: navigation inside damaged file systems and selective copy (press P then C)
  • Cross-platform: Windows, Linux, macOS (Intel + ARM64), FreeBSD, DOS, OpenBSD
  • Interface: text/CLI mode, keyboard-navigable

Limitations

  • High learning curve: the text interface confuses non-technical users
  • No file preview before recovery
  • Partial APFS support (read OK, repair limited)
  • Can't recover files when the FS structure is completely unrecoverable

PhotoRec: The File Carving Specialist

Lines of source code on a dark screen
Lines of source code on a dark screen

How File Carving Works

PhotoRec doesn't read file systems. It scans the disk byte by byte, looking for file signatures (magic bytes). Each format has a recognizable header: FF D8 FF for JPEG, 25 50 44 46 for PDF, 50 4B 03 04 for ZIP/DOCX/XLSX, etc.

The name "PhotoRec" is misleading: the tool recovers 500+ file formats — photos, videos, PDFs, Office documents, archives, SQLite databases, and more.

Ideal Use Cases for PhotoRec

  • Complete drive format (data is still there, pointers are gone)
  • Totally unrecoverable partition table even after TestDisk
  • Photo recovery from SD card that was reused or reformatted (photographer scenario)
  • Bulk extraction of specific file types from a crashed NAS

Limitations

  • File names lost: everything renamed f0000001.jpg, f0000002.jpg…
  • Directory structure not reconstructed: all files in numbered folders
  • Fragmented files rarely recoverable (file carving limitation)
  • Manual sorting required after recovery (thousands of files)

When to Use TestDisk: Concrete Cases and Steps

Case 1: Missing Partition Table (Drive Not Recognized)

Symptom: Windows shows "Disk Not Initialized," or Linux sees an empty disk with no partition.

Concrete steps:

  1. Download TestDisk from cgsecurity.org, run as Administrator (Windows) or root (Linux)
  2. Select the affected disk → Proceed
  3. Partition type: Intel (MBR) or EFI GPT (depending on your disk)
  4. AnalyseQuick Search
  5. If TestDisk finds the lost partition, it appears in green/red/yellow
  6. Press P to list files: if you see your files, the partition is recoverable
  7. Choose Write to write the table → reboot → verify in OS

Typical duration: 10 to 20 minutes for a healthy 1 TB HDD.

Case 2: NTFS Partition Showing as RAW

Symptom: Windows asks to format the partition, or the partition appears as RAW in Disk Management.

Steps:

  1. TestDisk → select disk → Analyse → the partition should appear
  2. If it shows with the correct FS: select → P to verify files
  3. If files visible: Write to restore → reboot
  4. If FS corrupted: from main menu → AdvancedBootRebuild BS (NTFS boot sector rebuild)
  5. After rebuild, re-test access from Windows

Case 3: Selective Recovery Without Rewriting the Table

Sometimes you don't want to write the table (risk on an unstable drive). TestDisk allows direct file copy:

  1. Analyse → find the partition → P to list files
  2. Navigate to the target folder
  3. C to copy the selected file/folder to another drive

Selective copy (P then C) is especially useful on unstable drives: it avoids any write to the source media. On GPT/Windows 11 configurations, the secondary GPT header (at the end of the disk) often serves as a backup copy when the primary one is corrupted, which makes reconstruction easier.

When to Use PhotoRec: Concrete Cases and Steps

Case 1: Formatted SD Card (Lost Photos)

The classic scenario: a photographer accidentally formats their SD card.

Steps:

  1. DO NOT write anything to the SD card after the incident (every write overwrites data)
  2. Launch PhotoRec → select the SD card
  3. Partition type: None (file carving on the entire disk, bypassing the partition table)
  4. Select file system: Other (for FAT/exFAT)
  5. Choose file types to recover (check JPG, RAW, PNG, MP4)
  6. Select the destination folder (on a DIFFERENT drive)
  7. Start → wait (45 min to 3h depending on size)

As long as the card hasn't been written to after formatting, PhotoRec usually recovers the vast majority of photos — but with generic names (f0000001.jpg…) and without the original directory structure. The more the card was reused after the incident, the lower the recovery rate.

Case 2: Fully Formatted Drive (Partition Recreated Empty)

  1. PhotoRec → select the entire drive (not just the partition)
  2. PartitionWhole disk
  3. Select source FS (NTFS, ext4, etc.) → Other if unknown
  4. Start the scan

Scan speed depends mostly on the media's throughput: a mechanical HDD is significantly slower than an NVMe SSD. Expect several hours for a full 500 GB scan on a mechanical drive, noticeably less on an SSD. Since a "Whole disk" scan is exhaustive, plan for time and a destination drive large enough to hold the results.

Case 3: Targeted Extraction After Ransomware

If some files aren't encrypted (older ransomware variant) and the table is intact but files are corrupted:

  1. PhotoRec on the affected partition
  2. Filter for only unencrypted formats (JPG, PNG, older PDF)
  3. Compare against the encrypted files present

Success rate highly variable depending on the ransomware variant.

Editorial pick
4.5 / 5

Prefer a GUI? Try EaseUS Data Recovery Wizard

Free tier up to 2 GB · Preview before recovery

Founded in 200430-day guaranteeFree 2 GB version
See the offer

Comparison Table: 10 Criteria

CriterionTestDisk 7.2PhotoRec 7.2
InterfaceCLI text modeCLI text mode
File systemsNTFS, FAT, ext4, exFAT, HFS+, APFS, UFS…FS-independent (file carving)
Recovery typesPartition tables, boot sectors, selective file copy500+ formats by signature
Scan speed (500 GB HDD)5–20 min (Quick) / 2–6h (Deep)3–8h (full scan)
Best results when…FS/partition structure is repairablerecent files, low fragmentation
Supported OSWin, Linux, macOS ARM64, BSD, DOSWin, Linux, macOS ARM64, BSD, DOS
File names preservedYes (if FS readable)No (generic names)
Directory structureYesNo
LicenseGPL v2 — 100% freeGPL v2 — 100% free
Communitycgsecurity.org forum active since 2002Same (same project)
Paid alternativeEaseUS, R-Studio, StellarEaseUS, GetDataBack, Disk Drill

Recommendation by Profile

General Public (Non-Technical Users)

Neither TestDisk nor PhotoRec — no graphical interface, risk of worsening the situation with wrong input. Direct recommendation: EaseUS Data Recovery Wizard (free tier up to 2 GB, file preview before payment, intuitive Windows/Mac interface). Perfect for deleted files, emptied recycle bin, simple lost partition.

Editorial pick
4.5 / 5

Try EaseUS Data Recovery Wizard for Free

GUI interface · 2 GB free · 30-day money-back guarantee

Founded in 200430-day guaranteeFree 2 GB version
See the offer

Tech / Sysadmin

TestDisk as the first reflex for any partition table or boot sector issue. CLI interface is familiar, root access available, no payment needed. Keep PhotoRec as backup if the FS is unrecoverable. Keep R-Studio or ddrescue for bad sector cases.

Photographer (SD Card Recovery)

PhotoRec is the best free tool for formatted SD cards. It recovers best when the card hasn't been reused after the incident. Procedure: DON'T reuse the card, PhotoRec in "Whole disk" mode with JPG/RAW/MP4 filter. Paid alternative to preserve file names: EaseUS Data Recovery Wizard (photo preview before recovery).

Forensics / Digital Investigation

Both tools together in sequence. TestDisk to document the partition state and reconstruct without writing (analysis-only mode). PhotoRec for exhaustive file carving extraction. Complement with Autopsy or FTK for complete forensic analysis. Both tools are included by default in Kali Linux and DEFT.


To go further: our complete guide to hard drive data recovery 2026 covers all methods (software + lab), and our article on data recovery cost helps decide when to go professional. If you're comparing commercial software, also read our EaseUS vs Recuva comparison and our selection of best data recovery software 2026.

Editorial pick
4.5 / 5

Get EaseUS Data Recovery Wizard

30 jours satisfait ou remboursé

Founded in 200430-day guaranteeFree 2 GB version
See the offer