How deleted files can be recovered
Deleting a file usually only marks its record and space as free. The data often stays on the drive until new data overwrites it, so it can sometimes...
File carving recovers files from raw data by looking for their content patterns, such as the start and end markers, instead of using file system records.
Many file types begin with a fixed byte pattern called a header, or magic number. Some also end with a footer. A carver scans the raw data, finds a header, and copies the bytes up to the footer or a size limit.
Carving is used when directory entries are missing or damaged, for example after deletion, formatting or a corrupted file system. The same idea is used on memory dumps.
Most carvers expect the file to be stored in one piece. Fragmented files, whose parts sit in different places, may come out broken or incomplete. Studies by Garfinkel found that a fair share of JPEG and Word files are fragmented.
Carved files have no name, no folder and no original times. Output can include false hits, so check each file. Carving from a forensic image is safer than from the original drive.
Basic header and footer carving is the simplest. Other methods use a maximum size, a length stored in the file, or checks of the file structure to confirm the result. Some tools can join fragments by testing which pieces fit together.
Always record the tool, the version and the signature set you used, so another examiner can repeat the result.
| File carving | File system recovery | |
|---|---|---|
| Uses | File content patterns | File system records |
| Names and times | Usually lost | Often kept |
| Works on formatted drives | Often yes | Only if records remain |
| Fragmented files | Weak | Better |
A memory card was formatted before it reached the lab. The file system shows no files. The examiner runs a carver on the image and recovers JPEG photos by their header and footer. The photos have generic names, so the examiner checks the embedded metadata for dates.
It reads the raw bytes and recognises file types by their own structure, so it does not need directory entries.
The carver expects the data to follow the header in one block, so pieces stored elsewhere are missed.
Written in our own words from public forensic training material and standards. Last reviewed 24 Nov 2026. Procedures and laws differ by country and agency. Follow your own lab's procedure.