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
Commit 6a88cd5
Browse filesBrowse the repository at this point in the historyBrowse files
The integrity check is read-only for every filesystem: no repairing fallback, no stdin for a fix question, errors to the FORCE gate
The optional check offered before encryption is called read-only, and for
f2fs it was not: fsck.f2fs --dry-run || fsck.f2fs -a. A fsck.f2fs without
--dry-run, or one that found errors, went on to -a, a repairing mode. -a
also exits 0 when it finds nothing it was told to fix, so on the real tools
(f2fs-tools 1.16) a damaged image that --dry-run reported with exit 4 came
back from the check as PASSED, every time - the FORCE gate never saw the
errors.
Audited, every filesystem's check:
- ext2/3/4 e2fsck -f -n, btrfs check --readonly, xfs_repair -n, vfat
fsck.fat -n: read-only already; unchanged but for stdin.
- f2fs: fsck.f2fs --dry-run alone. Whether it has --dry-run is read from
its usage first (a bare fsck.f2fs touches no device); without it the
check is skipped with a warning saying why. No -a, ever.
- ntfs: ntfsfix --no-action alone. ntfsfix || ntfsresize --info let
ntfsresize overrule an ntfsfix that refused the volume; both are
read-only, but the refusal was an error the FORCE gate never saw. Same
usage probe; without --no-action, a skip.
- every checker now runs with stdin from /dev/null. On damaged metadata
fsck.f2fs --dry-run asks "restore lost files? [Y/N]"; answered y, f2fs-
tools 1.16 segfaults; with stdin closed it exits 255, an error.
- a missing tool, or a filesystem with no read-only checker, is a skip,
reported as one - before, "cannot check" (exit 2) was shown as errors.
The verdict goes to a new integrity_check: clean, PASSED; skipped, a loud
warning that nothing was checked or repaired; errors, "Nothing was
repaired", the FORCE gate as before - and, before FORCE, what the shrink
that follows will do if you go on: ext2/3/4 run e2fsck -f -p then -y, f2fs
fsck.f2fs -f, both repairing, unless an earlier run already shrank it.
That shrink-phase fsck is unchanged; it is now stated, not implied.
Each check was run against the real tools on clean and damaged image files
first: none writes a byte (sha256 before and after), and the exit codes
used here are theirs - e2fsck 0/4, fsck.fat 0/1, ntfsfix 0/1, fsck.f2fs
--dry-run 0/4/255, xfs_repair and btrfs check 0.
Tests, uki-fixture-test.sh section 12 (no root): fs_check_ro against fake
checkers that record every call and whether stdin reached them - a
fsck.f2fs that rejects --dry-run must lead to a skip and no -a, no checker
may run anything but its read-only mode or be handed stdin, ntfsresize may
never decide; integrity_check's skip, pass, errors-to-FORCE and its warning
about the shrink; and fs_check_ro against the real tools on image files,
damaged ones included: every image byte-identical, the verdict the
checker's own. Against 1.6.6 it reports 15 failures, among them the -a call
and both damaged f2fs images passed. CI installs the filesystem tools in
the uki-fixtures job; no job is renamed.
docs/FILESYSTEMS.md gains the check's table and what each outcome does,
and its shrink cells say their fsck repairs; INSTALL and SECURITY match.
uki 145/0 (1 skip) on the M2 Max, and again with every Asahi signal hidden
in a user namespace; cmdline 71/0; bash -n and shellcheck -S warning clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| xfs | ⚠️ slack only |**none — XFS cannot shrink**|`xfs_db` dblocks × blocksize | accepted only when ≥ 32 MiB of slack already exists between filesystem end and partition end; grow via `xfs_growfs`|
15
-
| f2fs | ✅ |`resize.f2fs -t` (needs f2fs-tools ≥ 1.16) | none — the script asks on re-runs whether a previous shrink completed | common on SBC/flash installs |
15
+
| f2fs | ✅ |`resize.f2fs -t` (needs f2fs-tools ≥ 1.16), after a repairing `fsck.f2fs -f`| none — the script asks on re-runs whether a previous shrink completed | common on SBC/flash installs |
16
16
| ntfs | ✅ |`ntfsresize --size`|`ntfsresize --info`| data partitions; the resize marks the volume for a consistency check on the next Windows boot (normal) |
17
17
| vfat | ✅ |`fatresize`| none — asks on re-runs | data partitions / firmware copies |
18
18
| exfat | ❌ | no shrink tool exists | — | back up → `mkfs.exfat` on a LUKS container → restore |
19
19
| udf | ❌ | no shrink tool exists | — | same workaround as exfat |
20
20
| swap | ❌ (by design) | — | — | swap holds no data worth an in-place conversion; see below |
21
21
22
+
## The integrity check
23
+
24
+
Before anything is changed, a real run offers to check the target
25
+
filesystem (`LUKS_FSCK=yes|no`; a dry run skips it). The check is read-only
26
+
for every filesystem: no checker runs in a mode that can repair, and none is
27
+
handed your keyboard — stdin is closed, so no fix question can be answered.
28
+
29
+
| Filesystem | Check |
30
+
|---|---|
31
+
| ext4 / ext3 / ext2 |`e2fsck -f -n`|
32
+
| btrfs |`btrfs check --readonly`|
33
+
| xfs |`xfs_repair -n`|
34
+
| f2fs |`fsck.f2fs --dry-run`|
35
+
| ntfs |`ntfsfix --no-action`|
36
+
| vfat |`fsck.fat -n`|
37
+
38
+
-**Errors** are reported and nothing is repaired; the run stops unless you
39
+
type `FORCE` (`LUKS_FSCK_FORCE=FORCE`). If you go on, know that the shrink
40
+
that follows runs a repairing check of its own, because its tools need a
41
+
consistent filesystem — ext2/3/4 `e2fsck -f -p` and then `e2fsck -f -y`,
42
+
f2fs `fsck.f2fs -f` — unless an earlier run already shrank it. Both repair
43
+
what they find; the `FORCE` prompt says so.
44
+
-**No read-only checker on this machine** — a `fsck.f2fs` without
45
+
`--dry-run`, an `ntfsfix` without `--no-action`, a missing tool — and the
46
+
check is skipped with a warning that says why. It never falls back to a
47
+
repairing mode, as f2fs's did until 1.6.7 (`fsck.f2fs -a`).
48
+
22
49
## System vs data partitions
23
50
24
51
- A partition containing `/etc/fstab` is treated as an **installed system**:
0 commit comments