Skip to content

Installer: a system snapshot on iPadOS 12-14 is held space, and can go - #138

Open
ionutm87 wants to merge 2 commits into
OrchardLinux:mainfrom
ionutm87:fix/ios12-update-snapshot
Open

ionutm87 wants to merge 2 commits into
OrchardLinux:mainfrom
ionutm87:fix/ios12-update-snapshot

Conversation

@ionutm87

@ionutm87 ionutm87 commented Dec 2, 2026

Copy link
Copy Markdown

The bug

orchard install omarchy-a --split on an iPad Air (J71, iPadOS 12.5.8, checkra1n 0.12.4) showed "iPadOS 32 GB, 32 GB used" and "iPadOS can spare 0 GB right now", while Settings showed 11 GB used.

The companion's numbers (logged now on connect):

bytes
APFS container 31,999,918,080
allocated 12,638,662,656
APFS minimum 31,711,035,392
system snapshot com.apple.os.update-70289BA1…, removable, holds ≈ 18,998,099,968

flow_layout showed max(allocated, minimum) as used. The minimum is real: iPadOS's update snapshot, which iPadOS doesn't run from under checkra1n 0.12.4, keeps APFS from shrinking. This is resize-apfs#28 / resize-apfs PR #33. The companion already reported layout.systemSnapshot, but the installer ignored it and told the user to delete apps, which frees nothing here.

The change

  • Layout: it tells used space (allocated) from what iPadOS keeps (APFS's minimum), and carries the system snapshot. The split still never goes below the minimum.
  • Companion helper: a new request, remove_snapshot, calls resize-apfs's DeviceEngine.removeSnapshot, which keeps its own checks: revision, name, removable, no operation running. The helper gets the com.apple.private.vfs.snapshot entitlement for it. The installer waits up to 150 s and reads the layout again after a dropped connection. Documented in companion/PROTOCOL.md.
  • Judging the removal: it counts by APFS's minimum. On the J71 the engine's answer still listed the snapshot with its pre-removal numbers while the minimum had fallen to 13.1 GB, so a snapshot that claims to hold more than the minimum keeps above what is allocated is taken as gone.
  • CLI: it explains the snapshot and asks y/N before removing it. Without a terminal it stops and names --remove-snapshot. Removal is offered only where it gives the system its 10 GB.
  • Window: the no-room screen offers "Remove the snapshot…" with a second confirmation. ORCHARD_DEMO_SNAPSHOT=1 shows this case in the demo.
  • Snapshot that can't go: where iPadOS runs from it, or nothing names it, both apps say what holds the space and point to Resize APFS instead of "delete some apps".

Tested

  • cargo test for the whole workspace passes, including the app with --features gpui/runtime_shaders, because this Mac has no Metal toolchain. New tests:
    • fixtures with the J71's exact numbers, before and after the removal;
    • the flow's removal, refusal and confirmation;
    • the CLI's stopping points.
  • On the J71, with the owner's go for each attempt:
    • The fixed build showed "13 GB used, 19 GB more held" and removed the snapshot (--remove-snapshot). APFS's minimum went from 31.71 GB to 13.13 GB, so iPadOS can spare about 16 GB.
    • iPadOS then restarted normally to the Home Screen, with apps and data in place.
    • That run predates the minimum-based check above, so it reported "still there" from the engine's stale list.
  • Not yet seen:
    • the split screen after removal, with the fixed build, on the device;
    • the window's new screen, which compiles but hasn't been looked at.

Follow-ups (not here)

  • Rename-and-restart in the installer when iPadOS runs from its update snapshot (stock checkra1n).
  • resize-apfs's engine answering a removal with its pre-removal snapshot scan.
  • The helper log copied as an empty companion-*.log.

🤖 Generated with Claude Code

ionutm87 and others added 2 commits December 3, 2026 00:40
On an iPad Air (J71) with iPadOS 12.5.8 and checkra1n 0.12.4, --split said
"iPadOS 32 GB, 32 GB used" and "can spare 0 GB" while iPadOS used 12.6 GB.
The companion reported 12,638,662,656 bytes allocated but an APFS minimum of
31,711,035,392: iPadOS's update snapshot, which iPadOS doesn't run from under
checkra1n 0.12.4, held about 19 GB (resize-apfs#28). The installer showed
max(allocated, minimum) as used, and told the user to delete apps, which
frees nothing there.

- The layout now tells used (allocated) from what iPadOS keeps (APFS's
  minimum), and carries the system snapshot the companion already reported.
  The split still never goes below the minimum.
- The companion's helper answers remove_snapshot with resize-apfs's engine
  (its checks: current revision, the reported name, removable, no operation)
  and has the vfs snapshot entitlement for it. The installer waits up to
  150 s, and reads the layout again after a dropped connection.
- The CLI explains the snapshot and asks before removing it
  (--remove-snapshot without a terminal); the window's no-room screen offers
  "Remove the snapshot…" and asks once more. Both offer it only where it
  gives the system its 10 GB. Where the snapshot can't go, both say what
  holds the space and point to Resize APFS instead of "delete some apps".
- ORCHARD_DEMO_SNAPSHOT=1 shows that case in the window's demo.
- A removal counts by APFS's own minimum: on the J71 the engine's answer
  still listed the snapshot (its scan from before) while the minimum had
  fallen from 31.7 to 13.1 GB. A snapshot reported to hold more than the
  minimum keeps above what is allocated is taken as gone.
- The storage numbers the split is sized from go into the run log.

Assisted-by: LLM

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: LLM

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant