Skip to content
Tutorials Center
My learning

Topics

Lesson 8 of 36 ยท Principles and Evidence Handling

Forensic Imaging and Write Blockers

Learn how investigators make bit-for-bit forensic images, why write blockers matter, the raw and E01 formats, how bad sectors are handled and how to verify an image with hashes.

Examining an original disk directly is a mistake: just connecting it to a normal computer can change it, because operating systems love to write (they update access times, create hidden folders, run indexers). A forensic image solves this. It is an exact, sector-by-sector copy of the storage, including empty areas and deleted data, made through a path that cannot write to the source. All analysis then happens on copies of the image.

Logical versus physical imaging

  • A physical (bit-stream) image copies every sector of the device from the first to the last, whether the file system uses it or not. It preserves deleted files, slack space and unallocated areas. This is the default for evidence.
  • A logical image copies only selected files and folders as the operating system sees them. It is faster and sometimes the only option (cloud accounts, large servers, legal limits on scope), but it misses deleted data.
  • A targeted collection grabs specific artifacts (logs, registry hives, browser databases) for quick triage.

Write blockers

A write blocker is a device (or software setting) that lets read commands through and blocks anything that could modify the drive. Hardware blockers sit between the drive and your workstation (SATA, NVMe, USB adapters). Software blockers mount storage read-only, but are less trusted because a mistake or a bug can still allow a write.

flowchart LR
    D["Suspect drive"] --> W["Write blocker<br/>(read commands only)"]
    W --> L["Examiner workstation"]
    L --> I["Image file<br/>on evidence storage"]
    W -. "write commands blocked" .-> X["Rejected"]

Before use, test your blocker on a spare drive: try to write, and confirm the hash of the drive does not change.

Image formats

Format Extension Notes
Raw (dd) .dd, .raw, .img Exact bytes, no metadata, readable by every tool, same size as the disk
E01 (Expert Witness) .E01 Compressed, split into segments, stores case notes and the hash inside
AFF4 .aff4 Modern, extensible, supports several data streams
Split raw .001, .002 Raw cut into files that fit on media

E01 images record who made the image, when, and the hash, which helps the paperwork. Raw images are simple and universal.

Making an image (read-only sample commands)

These commands show the usual workflow on a Linux workstation. They are shown for explanation and not run on this page; always point if= at a write-blocked device and of= at evidence storage.

TEXT
# 1. Hash the source (sample)
$ sha256sum /dev/sdb
 3a7bd3e2...  /dev/sdb

# 2. Image with dc3dd, which hashes while copying (sample)
$ dc3dd if=/dev/sdb of=/evidence/E-001.dd hash=sha256 log=/evidence/E-001.log
 ...
 input results for device `/dev/sdb':
    500107862016 bytes ( 466 G ) copied ( 100% ), 4205 s, 113 M/s
    [ok] 3a7bd3e2...  (sha256)
 output results for file `/evidence/E-001.dd':
    [ok] 3a7bd3e2...  (sha256)

# 3. Verify later
$ sha256sum /evidence/E-001.dd
 3a7bd3e2...  /evidence/E-001.dd

The sample shows the input hash and output hash agreeing. ddrescue is another tool, built for failing drives.

Bad sectors and read errors

A damaged drive may fail to read some sectors. Imagers should continue, fill the unreadable area with zeros (and log the location) rather than stop. The log lists every error, so a missing region can be explained later and the hash of source and image may legitimately differ only in those areas (you hash what you could read). The simulation below imitates this.

Python Imaging a disk with bad sectors

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Zero filling keeps every later sector at the correct offset, which matters because file systems refer to data by position.

Verifying and working with the image

After imaging, hash the image again and compare with the source hash. When analysing, you open the image as a read-only file (tools like Autopsy or mount -o ro,loop). Even so, make a working copy so the master stays untouched.

The stand-in below acquires a small made-up "disk", verifies it, then shows how a single changed byte is caught.

Python Acquire, hash, verify, detect a change

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Special situations

  • SSDs and wear levelling: an SSD may silently remap blocks and run background TRIM or garbage collection, which can destroy deleted data on its own. Image early and expect fewer recoverable deleted files than on spinning disks.
  • Full-disk encryption: imaging the encrypted disk is possible, but analysis needs the key or a live capture of the unlocked system.
  • Live imaging: when a system cannot be shut down (a critical server), you capture a logical image or use snapshot features, and document that the system kept changing.
  • RAID and virtual machines: image each member disk, or image the virtual disk file and note the hypervisor snapshot state.
  • Hidden areas: host-protected areas (HPA) and device configuration overlays (DCO) can hide sectors; good imagers check for them.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is a physical image preferred over a logical image for evidence?

    A bit-stream copy preserves everything on the device, including data the file system no longer lists.
  2. 2. What is the job of a write blocker?

    Write blockers protect the original from accidental changes during acquisition.
  3. 3. A drive has unreadable sectors. What should the imager do?

    Continuing with a logged zero fill preserves the layout and documents the gap.
  4. 4. After making an image, what do you do to prove it is faithful?

    Matching hashes of source and image show the copy is bit-for-bit identical.

Summary

  • Forensic images are sector-by-sector copies made through a write blocker; analysis uses copies.
  • Physical imaging keeps deleted and hidden data; logical imaging is faster but partial.
  • Raw (dd) is universal; E01 adds compression and embedded case data.
  • Handle bad sectors by zero-filling and logging, keeping offsets intact.
  • Hash source and image, record both, and re-verify whenever you reopen the image.

Next: Authorization, ethics and legal basics