Computer Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Data recovery and backup in forensics

Practical, exam-focused notes on forensic data recovery and backup: definitions, principles, formulas for imaging and retention, worked examples, common mistakes and exam guidance.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Digital evidence often lives on storage devices. An engineer uses data recovery and forensic backup methods to copy, preserve and recover data without altering original evidence so the material can be analysed, presented in court, or used for incident response.

Key ideas

  • Write blocker — a hardware or software tool that prevents write commands reaching a storage device. Definition: a write blocker enforces read-only access to preserve original data integrity. Assumption: the write blocker itself must be trusted and documented. Hardware write blockers are preferred; relying only on OS-level read-only mounts is insufficient in forensic contexts.

  • Hash (cryptographic hash) — a deterministic function mapping arbitrary-length input to a fixed-length output (digest). Example: SHA-256 maps data to a 256-bit digest. Use: verify integrity of images (same digest → extremely high confidence data identical). Assumption: collision resistance of the hash algorithm (practically collision-free for SHA-256 currently). Prefer SHA-256 or better (or dual-hash) for new cases; avoid relying solely on MD5/SHA-1 due to known collision attacks.

  • Logical vs physical acquisition — physical acquisition copies raw device sectors including slack and deleted data; logical acquisition copies files as presented by the file system (does not include deleted/unallocated space). Derivation: physical = sector-level copy; logical = file-level export. Choose physical when deleted data or slack may be evidential. If full-disk encryption is enabled, a live logical acquisition (post-decryption) or key capture may be required to access plaintext; document key-handling.

  • File system metadata — structures the OS uses to map files to disk (examples: MFT in NTFS, inode table in ext). Definition: metadata are structured records (timestamps, allocation, size) used to locate and describe files. Assumption: metadata may be altered by activity; verify timelines with multiple sources.

  • Deleted file recovery — when a file is deleted, file system usually marks its allocation as free but does not overwrite the raw data immediately. Therefore, recovery is possible until the space is overwritten. Exact statement: deletion typically updates file system allocation metadata; data remains on disk until overwritten. Exception: on SSDs/flash with TRIM or aggressive garbage collection, deleted blocks may be promptly erased or return zeros, making recovery of deleted data unlikely.

  • File carving — recovering files by searching raw data for file signatures (headers/footers) without relying on file system metadata. Use when metadata absent or corrupted. Limitation: file carving often fails to reconstruct fragmented files; validate carved results with file-format checks and hashes.

  • Chain of custody — documentation showing who had control of evidence from collection to presentation. Exact requirement: record every transfer, the person, date/time, reason and method to maintain admissibility.

  • Diagram students should draw: For an answer requiring a storage layout, draw a rectangle labelled “Physical disk” split into: MBR/GPT at the start, then Partition 1 (label file system type and start/end LBA), Partition 2, Unallocated space. For a partition detail, draw a zoom showing file system area, allocated file clusters, unallocated clusters, slack space inside last cluster of a file, and the MFT/inode table location. Label each region clearly. For GPT, also depict the backup GPT header and partition table at the end of the disk.

Assumptions behind common exam derivations: when deriving time to image a disk you assume the sustained transfer rate is constant; when computing backup storage for retention you assume sizes are constant per period and compression/duplication effects are ignored unless stated.

Formulas

T = S / R — time to transfer or image

  • T = time (seconds, s), S = size (bytes, B), R = sustained transfer rate (bytes per second, B·s⁻¹). Applies for constant transfer rate; convert units consistently (1 GB = 10⁹ B in SI). If you perform a separate verification pass that rereads the source to hash/verify, approximate total time as 2S/R.

S_total = N_full·S_full + Σ_i S_inc_i — total storage needed for backups

  • S_total = total backup storage (bytes), N_full = number of full backups retained (unitless), S_full = size of one full backup (bytes), S_inc_i = sizes of incremental backups retained (bytes). Applies when full and incremental backups are stored separately. For differential backups (changes since the last full), replace Σ_i S_inc_i with Σ_j S_diff_j; restore requires the last full plus the latest differential, whereas incremental restore requires the last full plus all incrementals up to the target date.

H = hash(data) — integrity digest operation (conceptual)

  • H = digest (fixed-length, e.g., 256-bit for SHA-256), data = input binary. Use to check equality: if hash(image1) == hash(image2) then images are identical with very high probability. Unit: bits for digest length. Applies when using collision-resistant hash functions.

Note: for transfer rate problems, use SI units (B, B·s⁻¹) for consistency.

Worked examples

  1. Time to create a forensic image

Problem: Image a 1 TB drive at sustained 150 MB/s. Use SI units (1 TB = 10¹² B, 1 MB = 10⁶ B).

Steps:

  1. Formula: T = S / R.
  2. S = 1 TB = 1·10¹² B. R = 150 MB/s = 150·10⁶ B·s⁻¹.
  3. T = (1·10¹²) / (150·10⁶) = 6666.666... s.
  4. Convert: 6666.666 s = 111.111 min = 1 h + 51.111 min = 1 h 51 min 6.7 s.

Answer: About 1 hour 51 minutes 7 seconds.

  1. Backup storage planning (weekly full + daily incremental)

Problem: A server full image is 500 GB. Daily changed data is 20 GB. You make one full backup weekly and incremental backups on the other six days each week. You retain 4 weekly full backups and all incremental backups for those weeks. Compute storage.

Steps:

  1. One full = 500 GB. Daily incrementals per week = 6·20 = 120 GB.
  2. For 4 weeks: full backups = 4·500 = 2000 GB.
  3. Incrementals kept = 4·120 = 480 GB.
  4. Total = 2000 + 480 = 2480 GB = 2.48 TB (SI).

Answer: 2.48 TB of backup storage required (ignoring compression and deduplication).

  1. Model answer: Recovering a deleted NTFS file (long question)

Write an answer like this in steps:

  1. Secure scene and inventory device; note chain of custody entries (who, when, why).
  2. Use a hardware write blocker when connecting the drive to forensic workstation. State the write blocker model and serial number.
  3. Create a physical forensic image (bitstream) using a validated tool. Example command to remember (check tool and flags before use): dd if=/dev/sdX of=/evidence/image.dd bs=4M conv=sync,noerror (explain: bs = block size, conv flags to continue on read error). Prefer specialized tools (dcfldd, Guymager) that log metadata and create hashes.
  4. Calculate and record cryptographic hashes (e.g., SHA-256) of original device and image. Store hashes in report. Verify that the source and image hashes match (or that the image hash matches the value computed during acquisition).
  5. Work only on copies. Use forensic tools to parse the NTFS MFT for the file record and timestamps. If MFT entry flagged deleted, check the cluster allocation bitmap to see if clusters were reused.
  6. If clusters not reused, recover file by copying clusters from the image. If MFT absent or overwritten, perform file carving using file signatures; note fragmentation risk and validate file integrity by hash or file-format validation.
  7. Document every action, tool version, and command. Preserve logs and create a final integrity hash of recovered files and the image.

A full-marks answer lists commands, justification for physical imaging, hash verification, use of write blocker and chain-of-custody documentation.

Common mistakes

  • Assuming "delete" means data is gone — exam answers should say data persists until overwritten.
  • Mixing decimal (10⁹) and binary (2³⁰) prefixes without conversion — state which you use.
  • Using logical acquisition when physical acquisition is required (e.g., when deleted or slack data matters).
  • Not documenting tool versions, timestamps and chain-of-custody entries.
  • Relying only on file carving without validating recovered files against metadata and hashes.
  • Breaking incremental backup chains (e.g., deleting older incrementals), which prevents point-in-time restores; know restore dependencies for incremental vs differential backups.

For your exam

Typical question types:

  • Definitions (define forensic image, write blocker, hash) — include exact definition and one-line justification.
  • Short notes (compare logical vs physical acquisition; explain chain of custody) — list steps, pros/cons and examples.
  • Derivations (derive time to image or storage needed) — show formula, substitutions, unit conversions.
  • Numerical problems (transfer time, backup size) — give units, show calculations step-by-step.
  • Procedure/algorithm questions (steps to collect evidence from a suspect disk) — list exact steps with reasons, tools and documentation.
  • Diagrams (draw storage layout, label partitions, allocated/unallocated/slack) — draw rectangles and labels as described above.
  • Be prepared to state the 3-2-1 backup rule (3 copies, 2 different media, 1 offsite) and to contrast full, incremental, and differential strategies.

What a full-marks answer includes:

  • Clear definitions with bold terms.
  • Correct assumptions stated (e.g., use SI units, sustained transfer rate) and conversions.
  • Step-by-step derivation or procedure with tool names and flags where relevant.
  • Documentation points: hash values, tool versions, write blocker details, chain-of-custody notes.
  • Correct final numeric answer with units.

Quick check

  1. What is a forensic image?
  2. Why use a write blocker?
  3. Formula for time to copy a 2·10¹¹ B disk at 100·10⁶ B·s⁻¹.

Answers: A forensic image is a verbatim bit-for-bit copy of storage with integrity verification; to prevent writes to the original device and preserve evidence integrity; T = S / R = (2·10¹¹) / (100·10⁶) = 2000 s (≈33 min 20 s).

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?