Recover deleted files with PhotoRec
photorec scans a device sector by sector, ignoring the filesystem, and carves out files it recognizes by signature — often recovering data after rm, a quick format or a corrupted card.
01Command
$ sudo photorec /dev/sdb02What it does
PhotoRec's signature-based carving works even when the filesystem metadata is gone, supporting hundreds of formats (JPEG, MP4, PDF, DOCX...). It is read-only toward the source device, so further damage is unlikely. For files deleted from a healthy ext4/ext3 filesystem, try `testdisk` first, which can undelete via the filesystem itself and preserve names and paths.
03Risk
04Undo
$ null05Sources
- PhotoRec — file recoveryEvidence: PhotoRec step-by-step recovery of files from disks and cards
- PhotoRec Step By StepEvidence: advises writing recovered files to another disk
Last verified: 2026-09-18 · Category: Files & Folders
06Related solutions
autoremove deletes no-longer-needed dependency packages, and clean wipes the downloaded .deb cache in /var/cache/apt/archives.
ncdu scans a directory tree, then lets you browse sizes, navigate, and delete space hogs with one keypress.
Check how much space the binary journal consumes and permanently trim it by size, age, or file count.