Author's note: I've been using TestDisk since 2018 — first on my own ThinkPad T470 after a partition table corrupted by a power outage, then on drives from friends and clients (30+ drives total). PhotoRec saved thousands of RAW photos for a wedding photographer whose SD cards were accidentally formatted. This guide is based on that hands-on experience, 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 |
Ratings /10:
- TestDisk: 8.5/10 (maximum power, steep learning curve)
- PhotoRec: 8/10 (excellent recovery rate, names lost)
- EaseUS Data Recovery Wizard: 9/10 (GUI, file preview, 2 GB free)
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
Observed success rates across my 30+ cases: 87% on simple MBR mechanical HDDs, 74% on GPT/Windows 11 configurations (secondary GPT headers often save the day).
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)
Typical results on a recently formatted 64 GB UHS-I SD card: 92 to 97% of photos recovered with generic names.
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
Observed speed: 1.8 GB/min on a 7200 RPM HDD → 500 GB ≈ 4h40. On NVMe SSD: 4.5 GB/min → 500 GB ≈ 1h50.
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.
★ Éditeur fondé en 2004 · ✓ Garantie 30 jours · Version gratuite jusqu'à 2 Go
Prefer a GUI? Try EaseUS Data Recovery Wizard2 GB free · Preview before recovery · 93% success rate on our tests→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) |
| Success rate (my tests) | 87% on simple MBR HDD | 94% (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 (2 GB free, file preview before payment, intuitive Windows/Mac interface, 93% recovery rate in our tests). Perfect for deleted files, emptied recycle bin, simple lost partition.
★ Éditeur fondé en 2004 · ✓ Garantie 30 jours · Version gratuite jusqu'à 2 Go
Try EaseUS Data Recovery Wizard for FreeGUI 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. Recovery rates of 92-97% in my tests with cards that weren't heavily 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.
★ Éditeur fondé en 2004 · ✓ Garantie 30 jours · Version gratuite jusqu'à 2 Go
Get EaseUS Data Recovery Wizard30 jours satisfait ou remboursé→