# e2fsck: success, checked scope and preserved bytes

Two runs of 11 deliberate cases on new, unmounted regular-file ext4 images.
Observed 2026-12-04 with e2fsprogs 1.47.0. This is a controlled demonstration,
not a failure-rate study, benchmark, SQCK reproduction or current-version defect report.

## Result

A clean shortcut, a completed forced check and a forced check after one payload
bit was changed all returned zero. Only comparison with the independent original
payload distinguished the last case. More subtly, the forced read-only check
reported an incorrect superblock free-block total and declined its correction,
yet also returned zero. The source's PR_5_FREE_BLOCK_COUNT uses PR_NO_OK; refusal
of that particular fix does not invalidate the filesystem in fix_problem().
A wrong inode link count was the positive control: forced read-only checking
returned four, repair returned one, and the subsequent check returned zero.
The free-block-total repair also returned one; its recheck returned zero.

Do not turn these observations into a rule that every refused repair returns
zero. Group totals and other problem classes have different policies. Preserve
the transcript, options, version, configuration and input/output identity.

## Method

The observer creates a 64 MiB ext4 image with 4096-byte blocks, 256-byte inodes,
metadata_csum and no journal. It inserts an 8192-byte known payload, then creates
separate copies. One payload byte at logical offset 123 is XORed with 1 after
debugfs identifies its physical block. The free-block counter is reduced by one
with debugfs, which updates the associated checksum. The link-count control
sets the payload inode's link count to two although only one directory entry
exists. No mounting, device I/O, crash, journal replay or power fault occurs.

For each invocation the capture retains complete stdout/stderr, exit status,
reported pass headings, image SHA-256 before/after and extracted-payload SHA-256.
Read-only means a matching image hash here, not an assumed consequence of -n.
The independent reference is generated outside the image. Byte identities differ
between fresh captures because filesystem UUIDs and times are not fixed; semantic
case outcomes agree. The raw creation commands and configuration are included.
The two runs exercise the same environment, not independent hardware populations.

## Reproduce

Requires Python 3 and installed e2fsprogs utilities. No root privilege is needed.
Run from a writable scratch directory with about 300 MiB free; the observer
accepts only a new output JSON path, never a user image or device path.

```sh
python3 observe.py new-observation.json
python3 -B -m unittest discover -s . -p test_evidence.py
python3 -B -O -m unittest discover -s . -p test_evidence.py
python3 verify.py
```

The tests validate the two published captures, not new filesystem operations.
To inspect a new capture explicitly, import validate from verify.py and pass the
parsed JSON. It intentionally rejects a different e2fsck version: review a new
version as a separate observation rather than rewriting historical evidence.

## Literature and boundaries

Gunawi, Rajimwale, A. C. Arpaci-Dusseau and R. H. Arpaci-Dusseau, SQCK:
A Declarative File System Checker, OSDI 2008, separates structural consistency
from preservation of recoverable information. Section 2 uses type/location-aware
pointer corruption; section 5.3 reports e2fsck 1.39 in its performance setup.
Our experiment does not reproduce those faults or establish that its historical
repair defects persist. No DOI is asserted. Primary source locations are in
sources.json. Tagged 1.47.3 documentation supports the definition's separate
source review; native execution here is explicitly 1.47.0.

Pass headings are transcript evidence of those paths, not proof of every possible
consistency invariant. This no-journal fixture says nothing about replay,
mounted checks, cancellation, crash-safe repair, all ext4 feature combinations,
malicious images, media health or application-level recovery. A trusted hash
comparison verifies equality to that reference, not that the reference is the
desired latest version. Never run the demonstration's repair flags on live data.
