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?
| Situation | Recommended Tool |
|---|---|
| Corrupted or missing partition table | TestDisk |
| Inaccessible logical partition (RAW, corrupted FS) | TestDisk |
| Fully formatted drive, table unrecoverable, need photos/docs | PhotoRec |
| Fast file recovery by type (JPG, PDF…) | PhotoRec |
| Need file names and directory structure preserved | TestDisk (P listing) or EaseUS |
| Non-technical user, no CLI experience | EaseUS 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
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:
- Download TestDisk from cgsecurity.org, run as Administrator (Windows) or root (Linux)
- Select the affected disk →
Proceed - Partition type:
Intel(MBR) orEFI GPT(depending on your disk) Analyse→Quick Search- If TestDisk finds the lost partition, it appears in green/red/yellow
- Press
Pto list files: if you see your files, the partition is recoverable - Choose
Writeto 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:
- TestDisk → select disk →
Analyse→ the partition should appear - If it shows with the correct FS: select →
Pto verify files - If files visible:
Writeto restore → reboot - If FS corrupted: from main menu →
Advanced→Boot→Rebuild BS(NTFS boot sector rebuild) - 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:
- Analyse → find the partition →
Pto list files - Navigate to the target folder
Cto 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:
- DO NOT write anything to the SD card after the incident (every write overwrites data)
- Launch PhotoRec → select the SD card
- Partition type:
None(file carving on the entire disk, bypassing the partition table) - Select file system:
Other(for FAT/exFAT) - Choose file types to recover (check JPG, RAW, PNG, MP4)
- Select the destination folder (on a DIFFERENT drive)
- 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)
- PhotoRec → select the entire drive (not just the partition)
Partition→Whole disk- Select source FS (NTFS, ext4, etc.) →
Otherif unknown - 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:
- PhotoRec on the affected partition
- Filter for only unencrypted formats (JPG, PNG, older PDF)
- Compare against the encrypted files present
Success rate highly variable depending on the ransomware variant.
Prefer a GUI? Try EaseUS Data Recovery Wizard
Free tier up to 2 GB · Preview before recovery
Comparison Table: 10 Criteria
| Criterion | TestDisk 7.2 | PhotoRec 7.2 |
|---|---|---|
| Interface | CLI text mode | CLI text mode |
| File systems | NTFS, FAT, ext4, exFAT, HFS+, APFS, UFS… | FS-independent (file carving) |
| Recovery types | Partition tables, boot sectors, selective file copy | 500+ 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 repairable | recent files, low fragmentation |
| Supported OS | Win, Linux, macOS ARM64, BSD, DOS | Win, Linux, macOS ARM64, BSD, DOS |
| File names preserved | Yes (if FS readable) | No (generic names) |
| Directory structure | Yes | No |
| License | GPL v2 — 100% free | GPL v2 — 100% free |
| Community | cgsecurity.org forum active since 2002 | Same (same project) |
| Paid alternative | EaseUS, R-Studio, Stellar | EaseUS, 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.
Try EaseUS Data Recovery Wizard for Free
GUI interface · 2 GB free · 30-day money-back guarantee
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.
Get EaseUS Data Recovery Wizard
30 jours satisfait ou remboursé