PhotoRec for Mac is a free, open-source file recovery tool that scans storage devices for data remnants and restores deleted files, including photos, documents, and archives. You run it from the Terminal (or a graphical wrapper) and point it at a disk, partition, or disk image, and it recovers files to a folder you choose. It works even when the filesystem is damaged or the drive is formatted, because it identifies files by their content signatures rather than relying on the filesystem index.
What PhotoRec Actually Does
PhotoRec is part of the TestDisk family, a suite of data-recovery utilities developed by Christophe Grenier. It does not rely on the operating system’s file index (like the Mac’s Spotlight or the HFS+/APFS catalog). Instead, it performs a raw, sector-by-sector scan of the selected volume. It looks for known file signatures—the unique byte patterns at the start (and sometimes end) of common file types. When it finds a match, it copies that block of data to a destination folder, reconstructing the file from the raw bytes.
This signature-based approach is why PhotoRec can recover files from a drive that has been reformatted, repartitioned, or whose directory structure is corrupt. It is also why it can recover files from memory cards, USB sticks, and even the raw bytes of a disk image. However, it does not preserve original filenames or folder structure. Recovered files are named according to a pattern (e.g., f1234567.jpg) and placed in a single output directory, often with subdirectories based on file type.
How to Install and Run PhotoRec on macOS
There are two main ways to run PhotoRec on a Mac: the command-line version (the original) and a graphical interface called QPhotoRec. Both are included in the same download from the official TestDisk website or via package managers like Homebrew.
To install via Homebrew, open Terminal and run:
brew install testdisk
This installs both photorec and qphotorec. To launch the graphical version, type qphotorec in Terminal. The command-line version is started with sudo photorec (sudo is often required to access raw disk devices).
If you prefer not to use Homebrew, download the macOS binaries from the official CGSecurity site, unzip the archive, and run the executable from Terminal or double-click the .app bundle for QPhotoRec.
Step-by-Step: Using QPhotoRec (GUI)
QPhotoRec is the easiest way for most Mac users. Here is a typical workflow:
- Quit all other applications to minimize disk writes to the drive you are recovering from.
- Launch QPhotoRec from Terminal (
qphotorec) or by opening the .app file. - Select the disk or partition you want to scan. On macOS, you will see entries like
/dev/disk0(the whole disk) and/dev/disk0s2(a partition). Choose the partition if you know where the files were, or the whole disk if you are unsure. - Choose the file types to recover. By default, all known types are selected. You can deselect types you do not need to speed up the scan.
- Choose the destination folder where recovered files will be saved. Important: This must be on a different drive than the one being scanned, otherwise you risk overwriting the very data you are trying to recover.
- Click Search and wait. The scan can take hours, depending on the drive size and speed.
When the scan finishes, QPhotoRec will show a summary and the recovered files will be in the destination folder, organized by file type (e.g., jpg, doc, zip).
Common Problems and How to Work Around Them
PhotoRec is powerful but not foolproof. Here are the most common issues Mac users face:
- Recovered files won’t open: This often happens when the file was fragmented (stored in non-contiguous blocks) or partially overwritten. PhotoRec does not reassemble fragments; it recovers contiguous chunks. Try using a different recovery tool that reassembles fragments, or accept that some files may be corrupted.
- Scan is extremely slow: The default scan speed on a Mac may be limited by USB or Thunderbolt bandwidth. Closing other apps and using a direct SATA connection (if possible) can help. Also, deselecting file types you do not need reduces the number of signatures to check.
- “Permission denied” errors: On macOS, you often need to run PhotoRec with
sudoto access the raw disk device. In QPhotoRec, you may need to right-click and select “Open With > Terminal” or grant Full Disk Access in System Settings > Privacy & Security. - Recovered files have no names: This is by design. PhotoRec does not read the filesystem directory, so it cannot know the original names. You will need to rename files based on their content.
PhotoRec vs. Other Mac Recovery Tools
PhotoRec is often compared to commercial tools like Disk Drill, Data Rescue, or EaseUS Data Recovery Wizard. The key differences are:
- Cost: PhotoRec is completely free. Commercial tools typically have a free trial that limits the amount of data you can recover, then require a license.
- Ease of use: Commercial tools have polished GUIs with preview features and step-by-step wizards. PhotoRec’s GUI is functional but spartan, and the command-line version is intimidating for beginners.
- File name recovery: Commercial tools often attempt to reconstruct the original file names and folder structure by parsing the filesystem journal. PhotoRec does not.
- Effectiveness: For severely damaged drives or after a reformat, PhotoRec’s raw scan is often more effective because it ignores the filesystem entirely.
If you need original names and a friendly interface, a commercial tool may be worth the cost. If you need a free, powerful raw recovery, PhotoRec is hard to beat.
Safety and Best Practices
Data recovery is a delicate operation. Follow these rules to avoid making things worse:
- Stop using the drive immediately after you realize files are missing. Every write operation (even opening a file) can overwrite the data you want to recover.
- Never install PhotoRec on the same drive you are recovering from. Download it to another drive or a different computer, then connect the affected drive as an external device.
- Always recover to a different physical drive than the one being scanned. Recovering to the same drive risks overwriting unrecovered data.
- Use a disk image if possible. If you have enough free space, create a byte-for-byte image of the drive using
ddor Disk Utility, and run PhotoRec on the image. This is the safest method.
Frequently Asked Questions
Does PhotoRec work on APFS (Apple File System)? Yes. PhotoRec does not care about the filesystem type; it scans raw data. It works on APFS, HFS+, exFAT, FAT32, NTFS, and others.
Can PhotoRec recover files from a Time Machine backup? Yes, if the backup is stored on a local drive or network volume that PhotoRec can access. However, if the backup is on a Time Capsule, you may need to mount it as a network volume first.
Why are recovered files named like “f1234567.jpg”? PhotoRec assigns sequential numbers based on the order they are found. The original names are lost because the filesystem index is not read.
Is PhotoRec safe to use? Yes, it only reads from the source drive and writes to the destination you specify. It does not modify the source. However, always ensure the destination is different from the source.
What file types can PhotoRec recover? It supports hundreds of formats, including JPEG, PNG, RAW (from many camera brands), MP4, MOV, ZIP, DOC, PDF, and more. The full list is in the file doc/file_formats.txt included with the download.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Data Center Security: Encryption, Backups, Access
- Best Mini PCs for Gaming: Top Picks
- Phone Buttons: Clever Ways to Use Them
- Resonance Solstice Codes: What They Are
- Blue Protocol Star Resonance: Best Graphics Settings for Smooth FPS
- Jack Daniel’s Ransomware: Data Stolen?