Verifying a File Recovery with a Small Sample: Sample First, Then Decide Whether to Verify Everything
The first thing to do after a recovery finishes is not to celebrate — it is to verify by sampling. Recovery tools habitually report "file found" as success, …
- Added to the lab
- Downloads
- 0
- Human review
- Review information not provided
The first thing to do after a recovery finishes is not to celebrate — it is to verify by sampling. Recovery tools habitually report "file found" as success, but what they found may be only the file header; the clusters holding the actual body may long since have been overwritten by new data. A file that opens on double-click and displays an icon can still be only half there. The purpose of small-sample verification is to judge, at very low cost and before committing to a full verification, whether this batch of results is worth trusting — and which category of files the failures cluster in.
Sampling has to be structured; don't just pick the first few entries in the list. Take several items from each stratum by directory, format, and size, covering both the easy and the difficult ends. For example: an SD card that was accidentally formatted yielded more than three thousand recovered photos and a batch of documents. You could sample 20 items — 8 photos, 5 documents, 3 archives, and 4 video clips — including thumbnails of a few tens of KB and raw video of several hundred MB. Fragmentation level and storage location determine recovery difficulty; sampling only small files will systematically overestimate the success rate.
Verification must be independent of the recovery tool itself. Drawing conclusions from its built-in preview feature is like letting the defendant be the judge. For photos, check the JPEG start marker FFD8 and end marker FFD9, then decode the file fully with a different decoder. A DOCX is essentially a zip container — test its structure with unzip -t. For PDFs, check whether the trailing %%EOF and the cross-reference table are intact; for video, decode at least through the last frame. There is a common trap here: camera files embed a small preview image, and that is exactly what the recovery software displays. It looks flawless while only half of the main image data came back.
When you have the original copy, comparing hashes is the hardest evidence; matching SHA-256 basically closes the case. Without a copy, you are left with structural and semantic checks: whether a document can be fully reflowed, whether a table's row count matches the scale you remember, whether an image histogram has anomalous gaps. What this step is really after is silent corruption — the file opens, but content has quietly gone missing, and that kind of problem is hard to spot by eye.
What conclusions sampling can support needs to be stated clearly. If all 20 samples pass, by the "rule of three," at a 95% confidence level the upper bound on the overall defect rate is about 3/20, i.e., 15%. The smaller the sample, the looser that bound; with 5 out of 5 passing, the upper bound is still 60%. So the role of a small sample is to rule out "widespread failure," not to prove "everything is intact." Once one failure appears in the sample, the defect-rate estimate immediately jumps to around 5%, at which point you should enlarge the sample or go straight to full verification.
The limitations are just as obvious. Sampling is insensitive to low-frequency, scattered damage; recovery tools tend to fish out structurally intact, contiguously stored files first, so the sample is inherently biased; file names and directory structure are mostly gone, and correct content does not mean correct attribution — name collisions and overwrites can let "successfully recovered" files stand in for one another; and when recovering across drives, if the target drive fills up midway, the truncated files may happen not to be in the sample.
A safer procedure: first write the results to a different drive, so you don't overwrite data while recovering; sample in strata by type, recording the verification method and result for each item; if the samples all pass, take another round, and if that also passes, decide whether a full hash verification is worth doing. Full verification is time-consuming and needs extra space, but for data that cannot be regenerated, that cost usually pays off; for movies and installers you can simply re-download, passing the sample is enough.