You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
os/mini: prepare-stick stages models with no free-space preflight, so a failed grow/resize truncates a model file instead of refusing (recurrence, c32) #1374
Observed (c32, 2026-11-07). The chain's stage step died ENOSPC after a successful write/readback: the data partition was 58.1 GiB but the filesystem was still 7.8 GiB, so 6.6 of 7.9 GB of models landed and sd_turbo.safetensors was truncated. It was caught only by byte-comparing the model tree against its source — a merged/partial tree cannot be proven by du -sb, which is what makes this a silent-corruption class rather than a loud failure. Recovering took a hand written restage step: e2fsck -f → resize2fs (fs then 58.1 GiB) → clear the partial tree → stage again. This is the second
occurrence of the resize failing.
Four defects in os/mini/prepare-stick.sh, in the order they bite:
No free-space preflight before staging. The model loops cp one file at a time and only notice a full filesystem when a
copy fails — and a copy that fails part way leaves a truncated file behind, which is worse than a refusal. The script already
prints free space at the end (df -h), so it knows how to ask.
A failed grow is silent by design, and that is right for the fallback but wrong for the copy.grow_data returns 0 on sgdisk/sfdisk failure ("the partition is left exactly as it was", a working 2 GiB stick), GREW stays 0, resize2fs is
skipped, and the script goes on to stage models into a filesystem that cannot hold them. The fallback is fine; what is missing
is the matching check that the staging still fits.
resize2fs runs with no e2fsck and no retry. An ext4 that needs journal recovery makes resize2fs refuse — the operator's
workaround (e2fsck -f first, then resize) is the evidence. The script should do that itself: resize, and on failure fsck the
unmounted partition and retry once before dying.
The success line reports the partition size as the filesystem size. It prints s * 512 / GiB from the partition table as
"now holds %.1f GiB of ext4", which is the number that made the failure confusing in the first place: the partition really did
grow to 58.1 GiB while the fs did not.
Fix shape (one file, no behaviour change on a healthy stick): compute the bytes to stage and compare with df --output=avail on the mounted data partition before copying, refusing with both numbers (and naming the likely cause: the
grow or the resize did not happen); e2fsck -f -y then one resize2fs retry; print the filesystem size from the filesystem
(dumpe2fs -h) instead of the partition; and keep the existing "a failed grow leaves a working stick" fallback, now backed by a
staging check that refuses instead of truncating.
Not a gate change: this is the tool that prepares the medium; the release gates already byte-verify the staged tree (which is how
this was caught), and they should not have to be the thing that discovers a truncated model.
pi-tui is taking this one (unowned, and it is the tool that prepares the medium my lane's console ships on).
Plan, in the issue's own order and with a reproduction first: (1) a free-space preflight in the staging loops that refuses with both numbers instead of truncating; (2) keep grow_data's silent fallback but make the staging check the thing that notices; (3) e2fsck -f -y + one resize2fs retry; (4) report the filesystem size from dumpe2fs -h, not the partition table. I will reproduce the truncation on a small file-backed ext4 (no stick needed) and post the before/after numbers in the PR.
Activity
bong-water-water-bong commentedon Nov 8, 2026
pi-tui is taking this one (unowned, and it is the tool that prepares the medium my lane's console ships on).
Plan, in the issue's own order and with a reproduction first: (1) a free-space preflight in the staging loops that refuses with both numbers instead of truncating; (2) keep
grow_data's silent fallback but make the staging check the thing that notices; (3)e2fsck -f -y+ oneresize2fsretry; (4) report the filesystem size fromdumpe2fs -h, not the partition table. I will reproduce the truncation on a small file-backed ext4 (no stick needed) and post the before/after numbers in the PR.prepare-stick: prove the staged bytes, count allocated bytes, and nam…
prepare-stick: prove the bytes under --check too, and survive an unre…