recovering-deleted-files-with-photorec

Recover deleted files from disk images and storage media using PhotoRec signature-based carving.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill recovering-deleted-files-with-photorec
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: recovering-deleted-files-with-photorec
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/digital-forensics/recovering-deleted-files-with-photorec
Command: npx skills add https://github.com/xalgord/xalgorix --skill recovering-deleted-files-with-photorec

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Deleted files, formatted drives, and corrupted file systems make evidence and data appear lost, even though the underlying bytes often remain in unallocated disk sectors. This Skill guides forensic recovery of those files using PhotoRec's signature-based carving, which bypasses the file system entirely.

Core Features & Use Cases

  • Signature-Based File Carving: Recover 300+ file formats (documents, images, videos, databases, archives) from raw disk sectors regardless of file system damage.
  • Targeted Recovery: Run non-interactive PhotoRec commands limited to specific file types (docx, pdf, jpg, sqlite) to speed up scans and reduce noise.
  • Validation & Cataloging: Hash recovered files with SHA-256, verify integrity with file signatures and jpeginfo, and filter known-good files against NSRL hash sets.
  • Use Case: During an investigation of a suspect's USB drive, image the device with dcfldd, carve deleted documents and images with PhotoRec, then hash and catalog the output for the evidence chain.

Quick Start

Use PhotoRec to recover deleted documents and images from the forensic image evidence.dd into the case recovery directory, then hash and validate the results.

Frequently Asked Questions about recovering-deleted-files-with-photorec

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I recover deleted files with PhotoRec?

Run photorec against a forensic image or device, select the partition and filesystem type, choose Free (unallocated) or Whole scan scope, and set an output directory. Non-interactive mode uses /d and /cmd flags with fileopt filters to target specific file types.

Can PhotoRec recover files from a formatted hard drive?

Yes, PhotoRec bypasses the file system and carves files directly from raw sectors using header/footer signatures, so formatting does not prevent recovery. Use Whole scan mode on the partition and expect a higher false positive rate from fragmentation.

Why does PhotoRec recover files without original names or timestamps?

Carving bypasses the file system, so output files are named fNNNNNNN.ext in recup_dir folders with the recovery time as mtime. To restore names and MAC times, correlate results with $MFT, USN journal, or inode records separately.

Does PhotoRec work on SSDs with TRIM enabled?

Most deleted data on SSDs is unrecoverable after TRIM executes, since the blocks are cleared at the hardware level. PhotoRec only recovers data still resident in unallocated sectors, so overwritten or TRIM'd regions yield nothing.

PhotoRec vs Foremost vs Scalpel for file carving?

PhotoRec supports 300+ formats with interactive and command-line modes and ships with TestDisk. Foremost and Scalpel are alternative carvers; Scalpel offers higher performance through multi-threading and configuration-based signatures.

Why are some recovered files corrupted or truncated?

Fragmented files stored in non-contiguous clusters are carved only up to the first gap, producing truncated output. Validate every carved file with file signature checks, jpeginfo -c for images, and format-specific openers before treating results as complete.