PhotoRec on a Mac: an honest terminal walkthrough, and when you'll want more
PhotoRec is the free file carver bundled with TestDisk. It has been recovering photos from formatted cards since long before most commercial tools existed, it's open source, and it runs on a Mac. It's also a terminal program with a text menu, it names files by sector number, and it doesn't preview or repair anything. Both halves of that are true, and this walkthrough is meant to give you the real experience so you can decide whether it's the tool for your situation.
Install
Install Homebrew if you don't have it (instructions at brew.sh), then in Terminal: `brew install testdisk`. That installs both `testdisk` and `photorec`. Confirm with `photorec --version`.
PhotoRec has to read the raw device, so it needs root: you'll run it with `sudo`. On macOS 13 and later, the terminal app you use needs Full Disk Access (System Settings → Privacy & Security → Full Disk Access) or PhotoRec will fail to open the disk with a permissions error even under `sudo`.
Identify the disk
Before running anything, find the device name. `diskutil list` prints every disk and partition. The card or drive you want will be something like `/dev/disk4`, with a partition at `/dev/disk4s1`. Check the size to be sure. Getting this wrong means scanning the wrong disk; PhotoRec is read-only on the source, so a mistake wastes time but doesn't destroy anything. Unmount the volume first so nothing writes to it while you work: `diskutil unmountDisk /dev/disk4`.
Also decide where recovered files will go. PhotoRec writes into numbered folders (`recup_dir.1`, `recup_dir.2`, ...) under a destination you pick. That destination must be on a different drive than the source. Make a folder on your Mac's disk or an external and note the path.
Run it
`sudo photorec /dev/disk4` (use the raw device name; `/dev/rdisk4` is faster on macOS). PhotoRec opens its text interface. Use the arrow keys and Enter.
1. Select the disk. It's already selected if you passed it on the command line; confirm with Proceed.
2. Select the partition, or choose the whole disk ("No partition") if the partition table is gone or the card was formatted.
3. Choose the filesystem type: "Other" for exFAT, FAT32, NTFS, HFS+ and APFS. ("ext2/ext3" is only for Linux filesystems.)
4. Choose "Free" to scan only unallocated space (deleted files on an intact filesystem) or "Whole" to scan every sector (formatted or damaged). Whole is slower and finds more.
5. Pick the destination folder with the arrow keys, then press C to start.
Before step 5, the Options screen is worth a look. Paranoid mode (default: yes) validates carved files and drops ones that don't decode, which cuts junk at the cost of speed. Turning it to "Yes (brute force)" tries harder on fragmented JPEGs and is very slow. Keep corrupted files (default: no) keeps files that failed validation; turn it on if you're trying to salvage everything. File Opts lets you restrict which formats it looks for; limiting to jpg, cr2, mov, and so on speeds the scan and reduces noise.
The scan runs with a progress readout and can be stopped and resumed. On a 128 GB card in a decent reader, plan on tens of minutes to a couple of hours, depending on how much of the card is in use.
What you get back
A stack of `recup_dir.N` folders each holding a few hundred files named like `f1234567.jpg`, `f1236001.cr2`, `f1300112.mov`. The number is the sector where the file started. There are no original names, no folder structure, and no way to tell a keeper from a test shot without opening each one. Files carved from an intact filesystem are usually fine. Files carved from a formatted card of large, fragmented clips often have the wrong tail, and video files without a `moov` atom won't play. PhotoRec doesn't fix any of that; it's a carver, and it's a good one, but its job ends when the bytes are written.
Sort through the results with Finder's icon view, or `qlmanage -p` on a folder to Quick Look a batch. TIFF-based RAWs (Sony ARW, Nikon NEF and friends) come back as `.tif` and need renaming before Preview opens them. This is fully doable. On a card with three thousand frames it's an afternoon.
Where a GUI with preview and repair helps
The honest comparison: PhotoRec finds files. What it doesn't do is anything that makes those files easier to use. DataRecover Pro's quick scan reads the filesystem (APFS, HFS+, exFAT, FAT32, NTFS) and returns deleted files with their original names and folder paths, which PhotoRec structurally cannot do. Its deep scan carves the same formats, but sizes each file from its own structure, labels TIFF-based RAWs by their maker (`.arw`, `.nef`, `.orf`), and separates HEIC from MP4 by brand. The results grid shows thumbnails, Quick Look previews, and lets you select the frames you want rather than recovering all of them. And a repair engine rebuilds JPEGs with damaged headers, MP4/MOV with missing indexes or wrong offsets, PDFs, and DOCX containers, and extracts the embedded preview from a RAW whose sensor data is gone; see the repair page.
Scanning and preview are free, need no account, and nothing leaves your Mac; the app is notarized by Apple. Recovery and repair are $89 lifetime or $59 a year for 3 Macs, and if it can't recover your files, you don't pay. A fair sequence is: run PhotoRec if you're comfortable in the terminal and your files are intact and few; run DataRecover Pro's free scan when you want to see what's recoverable with names and thumbnails before deciding anything. Download DataRecover Pro.
When this won't work
PhotoRec and any other software share the same floor. A drive that's clicking, undetected, or reporting the wrong capacity needs a recovery lab, not a scan. Blocks overwritten by new data or erased by TRIM on an SSD are gone. PhotoRec can't read an encrypted APFS volume; DataRecover Pro can unlock one with your passphrase, but neither can bypass it. And for a card that's returning read errors, both tools do better against a byte-to-byte image than against the live card. The head-to-head is in DataRecover Pro vs PhotoRec.
Lost a file? Get it back.
Scan and preview for free. See what's recoverable before you buy.
Download for macOS