PhotoRec
Open sourceActive
PhotoRec is a free, open-source file carver from CGSecurity that ignores the file system and recovers files by recognising known file signatures. Its documentation covers hard disks, memory cards, USB drives and raw or E01 images, and its FAQ describes recovering data from phones that expose storage in USB mass storage mode or from a phone's memory card in a card reader. It is the companion to TestDisk; its step-by-step guide notes a /log option for forensic users.
Facts
| Website | cgsecurity.org |
|---|---|
| Vendor | CGSecurity (Christophe Grenier) |
| Licence | Open source (GPL-2.0-or-later (per the CGSecurity wiki, 'GNU General Public License (GPL v2+)'; source file headers such as src/photorec.c state 'either version 2 of the License, or (at your option) any later version')) |
| Category | Recovery and carving |
| Functions | Recovery, Carving |
| Targets | Android, Memory cards |
| Runs on | Windows, Linux, macOS |
| Pricing | Free [cgsecurity.org] |
| Users | Private recovery, Open-source DFIR community, Research |
| Last activity | 2026-10 · Repository commit 2026-10-25; latest stable release 7.2 (2024-02-22), 7.3-WIP beta listed [github.com] |
| GitHub activity | cgsecurity/testdisk · 2,675 stars · last push 2026-11-08 · checked 2026-11-10 |
Capabilities
- Designed to recover lost files, including video, documents and archives from hard disks, CD-ROMs and digital camera memory. It ignores the file system and works from the underlying data, so it still works if the file system is severely damaged or reformatted. [cgsecurity.org]
- Works with memory cards (CompactFlash, Memory Stick, SD, SmartMedia, Microdrive, MMC and others), USB drives, dd raw images and EnCase E01 images, and has been tested with portable media players including iPod. [cgsecurity.org]
- Recognises more than 480 file extensions (about 300 file families) using a signature database; if the data is not fragmented the whole file can be recovered. [cgsecurity.org]
- Uses read-only access to handle the drive or memory card being recovered from. [cgsecurity.org]
- For forensic users, a /log parameter creates a photorec.log that records the location of the files PhotoRec recovered. [cgsecurity.org]
- The FAQ states that devices connected via USB (including phones) in USB mass storage mode count as directly attached storage, and that a phone's memory card can be read through a USB card reader. [cgsecurity.org]
Limitations
- The FAQ lists a phone or camera in Media Transfer Protocol (MTP) mode under network-attached storage, and states TestDisk and PhotoRec can recover data from direct-attached and SAN storage while NAS needs the tools to run on the server itself. [cgsecurity.org]
- The FAQ's instructions for enabling USB mass storage cover BlackBerry, Android 2.1 to 4.2 and Windows Phone 7 (page metadata gives a last-modified date of 2019-05-04), so they do not describe current phones. [cgsecurity.org]
- If data is fragmented, only 'some' fragmented files can be recovered; a recovered file may be larger than the original unless the size can be learned from the file header. [cgsecurity.org]
- The FAQ states PhotoRec usually cannot recover original file names: it builds the file name from the logical sector number and only sometimes finds a name stored in the file itself. For named files on an undamaged file system it points to TestDisk, which works for FAT, NTFS and ext2. [cgsecurity.org]
Links
Related tools
- TestDisk · Recovery and carving
- Foremost · Recovery and carving
- Scalpel · Recovery and carving
- bulk_extractor · Recovery and carving
- Autopsy · Forensic suites
Sources
- PhotoRec - CGSecurity wiki (cgsecurity.org)
- PhotoRec FAQ - CGSecurity wiki (cgsecurity.org)
- PhotoRec step by step - CGSecurity wiki (cgsecurity.org)
- TestDisk and PhotoRec downloads (cgsecurity.org)
- cgsecurity/testdisk repository (github.com)
- GitHub: cgsecurity/testdisk commits (github.com)
- photorec.c source file header (licence notice) (github.com)
Reviewed . Spotted an error? See the corrections policy.