Overview
The project grew from operating-systems coursework into an installable Python/React workbench. It reads the volume image directly, including the BPB, packed FAT entries, directory records, and cluster data, instead of substituting folders on the host system.
Problem & motivation
How can a volume be reorganized while preserving active bytes and metadata, rejecting stale plans, and making recovery behavior visible? The work treats correctness and failure evidence as part of the interface.
My contributions
The source code, experimental protocol, and test records are available for review. Implementation, debugging, and verification were extensively AI-assisted; I do not claim unaided development or a research publication.
- Implemented FAT12 operations on image bytes, allocation analysis, and deterministic relocation, with plans available for review before changing the image.
- Added snapshots, operating-system process locks, stale-version rejection, and tests focused on failure cases.
- Documented test procedures and engineering limits alongside the implemented behavior.
Technology stack
The Python 3.11+ runtime uses the standard library. The interface uses React, TypeScript, and Vite; tests use unittest and actual child processes. Optional PyFatFS checks interoperability independently, while runtime FAT operations use the project engine.
System architecture
The CLI and local HTTP interface call the same FAT12 engine. Allocation analysis builds and validates a separate candidate image. The engine handles transaction rollback and protection snapshots; the storage layer handles process locks, content-version checks, fsync, and atomic file replacement.
- Read image / validate BPB and ownership
- Analyze allocation / bind preview to SHA256
- Build candidate / relocate data and references
- Validate / snapshot / guarded atomic write
Implemented module responsibilities; details and limits are in the public architecture document.
Technical challenges
Relocation must rewrite both FAT copies and first-cluster fields inside moved or expanded directories, including dot and parent references. Bad clusters must remain unavailable. A stale preview or competing writer must never overwrite a newer disk.
Implementation
Objects are packed in sorted-path order while avoiding bad clusters. A preview is tied to the source SHA256 and leaves the image unchanged. Applying it revalidates the candidate, saves a snapshot of the previous image, and writes through the protection layer. After a change, the React interface discards the old preview; applying a plan is disabled in read-only mode.
from fat12lab import FAT12
fs = FAT12.open("working-copy.img")
plan = fs.plan_defragmentation()
if plan["moved_clusters"]:
fs.defragment(plan["image_sha256"])
assert fs.check()["ok"]Results & evidence
91 local backend tests and 12 browser flows passed in the dated receipts. The fixed-seed ordinary layouts reduce file extents 33 → 23, with matching content-and-metadata hashes and zero moves on a second plan. This is not a disk-speed benchmark.
Evidence scope
Local checks recorded on 2026-10-25, using Python 3.13.7 on Windows.
Receipts describe software checks on synthetic/demo images and independent FAT interoperability. They do not establish production use, field durability, new research findings or unaided authorship.
Reflection & future work
The current scope is unpartitioned FAT12 volume images with ASCII 8.3 names, two FAT copies, and a maximum size of 16MiB. Whole-image transactions incur copying costs but keep rollback behavior explicit. Process-termination tests do not establish power-loss durability; there is no power-loss journal, LFN support, or FAT16/32 support. Broader workloads should be tested before extending the format support.
Code, demo & documentation
Links below provide the public source, installation instructions, architecture, experiments, and test records. The Python application runs locally; this page shows captured screenshots and evidence. The linked Actions workflow records the remote platform results.
Public GitHub repositoryArchitecture & tradeoffsReproduce the experimentActual CI runsDated verification receipts (JSON)
