Skip to content

update: warn before reboot when root Btrfs spans a second LUKS device - #12932

Open
kvnloo wants to merge 16 commits into
omacom:quattrofrom
kvnloo:salvage/t1-install-arch-recut-20260922
Open

kvnloo wants to merge 16 commits into
omacom:quattrofrom
kvnloo:salvage/t1-install-arch-recut-20260922

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What changes

omarchy update now warns before reboot when the root Btrfs filesystem spans a second LUKS device. The stock encrypt hook opens one cryptdevice=, and btrfs device add commits the new member immediately, so such a machine can drop to the initramfs on its next boot.

  • New hidden helper bin/omarchy-root-btrfs-extra-luks: lists the root filesystem's members with sudo -n btrfs filesystem show / and finds each member's first crypto_LUKS ancestor with flat lsblk -nslpo. It warns (exit 1) only when a member sits behind a different LUKS container than the root. It fails open and stays silent when btrfs, lsblk or findmnt is missing, when the root is not Btrfs, or when sudo is not already authorised.
  • bin/omarchy-update-analyze-logs calls it as advisory (|| true), so it never blocks an update.
  • The warning asks the user to check that the active initramfs unlocks every member. It does not advise removing a device, because sd-encrypt/crypttab setups may already handle it.

The x86_64 Install-menu gating that this PR used to carry has been dropped: as @birkskyum noted, those rows now resolve on aarch64 or are gated by omarchy-hw-x86 (#14431, #15753).

Verification

Run on a disposable Ubuntu sandbox at head f8a31acef:

  • bash test/shell.d/root-btrfs-extra-luks-test.sh: 13/13 ok, exit 0.
  • Removal controls (each reverted afterwards):
    • tree-form lsblk -nspo instead of -nslpo → not ok - members behind one LUKS mapping are safe
    • btrfs without sudo -n → not ok - noninteractive sudo denial is fail-open
    • helper replaced by exit 0 → test exits 1
  • git merge-tree against current quattro (cdd18b226): no conflicts.

Not checked: a real multi-device LUKS Btrfs install.

Screenshots

No visible change: a terminal warning during omarchy update only on multi-device encrypted Btrfs roots.

Prepared by Claude Opus 5.5 via Hermes Agent; reviewed under kvnloo's account.

@kvnloo kvnloo changed the title salvage(install-arch): leftover cluster (#11023 #11025) fix: install/arch leftovers (#11023 #11025) Sep 22, 2026
@llstrk

llstrk commented Sep 22, 2026

Copy link
Copy Markdown

No important actionable production defect was found in the tested scope at fb1ba61e.

Verified: The seven changed Install rows retain their installed-state dimming on x86_64 and are hidden for modeled aarch64/arm64 systems. Checks exercised the production menu model and generated guards with synthetic architecture and package-presence responses.

Modeled machine/state Base PR
x86_64, absent 7 selectable rows 7 selectable rows
x86_64, installed 7 dimmed rows 7 dimmed rows
aarch64/arm64, either state 7 visible rows 0 visible rows

Verified: With synthetic storage responses, a distinct extra LUKS-backed Btrfs member produces the warning; single-member, plain-extra-member and same-LUKS-container cases remain silent. Root aliases and subvolume suffixes were covered. The production update-log analyzer preserves the warning without failing:

Modeled root: LUKS A + LUKS B
  helper detects distinct encrypted member
    warning on stderr, exit 1
  analyzer's `|| true`
    warning retained, exit 0

Review information

Test scope: Targeted base/head menu and helper checks, update-log integration, and source inspection. No rendered desktop, native ARM installation, complete ARM package-availability audit, real multi-device Btrfs boot, or full repository suite. Storage detection used stubs; native enumeration permissions were not validated. The warning assumes the stock unlock setup and does not inspect a customized multi-device initramfs configuration.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Astra initial inspection, independent Opus 5.5 High and Astra Xhigh technical reviews, followed by Astra adjudication of the reports and targeted evidence.

@kvnloo

kvnloo commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Verified against current quattro (fail-then-pass on scoped shell tests). Ready for maintainer review.

Scoped: root-btrfs-extra-luks-test, hw-x86-64-test, menu-test.

@jandrusk

jandrusk commented Oct 8, 2026

Copy link
Copy Markdown

Thanks for re-cutting these. Two notes:

  • NIT, omarchy-root-btrfs-extra-luks: lsblk -nspo NAME,FSTYPE prints in tree form, so ancestor names come back with └─ prefixes whose depth depends on the stack. Two members on the same LUKS container at different depths (for example one directly on it and one through LVM) would then compare as different and warn falsely. List mode avoids that:

    done < <(lsblk -nslpo NAME,FSTYPE "$device" 2>/dev/null)

    The test stubs lsblk with flat output, so it can't catch this.

  • Scope: the extra-LUKS warning and the x86_64-only Install gating are unrelated changes. Splitting them would let each land on its own. Which rows count as x86_64-only (Zed, Cursor, Ollama, and so on) is also a product call that may change as omarchy-pkgs adds aarch64 builds.

@birkskyum

Copy link
Copy Markdown
Contributor

The Install gating here has gone stale on quattro. Ollama, LM Studio, Cursor, Zed and Symfony CLI all resolve on aarch64 now, and Edge, Dropbox and Spotify have been gated by omarchy-hw-x86 since #14431, so omarchy-hw-x86-64 and the menu hunks can go. #15753 hides the three Install rows that still can't work on ARM (GeForce NOW, Lutris, Battle.net). That leaves the Btrfs extra-LUKS warning as this PR's own change.

@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no outstanding blocking issues were found.

Summary

Adds an advisory warning when root Btrfs spans separate LUKS-backed devices.

  • Updates warn when root Btrfs needs another LUKS unlock.

Reviews (3) · Last reviewed commit: "test(storage): exercise unencrypted Btrf..." · Reviewed by Greptile

Comment thread bin/omarchy-root-btrfs-extra-luks Resolved
Comment thread bin/omarchy-root-btrfs-extra-luks Resolved
@kvnloo kvnloo changed the title fix: install/arch leftovers (#11023 #11025) update: warn before reboot when root Btrfs spans a second LUKS device Nov 25, 2026
@kvnloo

kvnloo commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Catching up on the October notes; the code changes landed on 10-18 but I never replied. Retitled, and the description now covers only the Btrfs extra-LUKS warning.

  • @jandrusk's tree-form lsblk NIT: fixed in ee35e98 (lsblk -nslpo), with a tree-form regression in eb8c5cb.
  • @birkskyum's stale Install gating: dropped in the quattro merge 5b90667. omarchy-hw-x86-64 and the menu hunks are gone; the diff is now bin/omarchy-root-btrfs-extra-luks, one advisory call in bin/omarchy-update-analyze-logs, and the test.
  • Greptile's two notes: c23d9f1 probes with sudo -n (it uses the update's sudo timestamp, and stays silent if that has lapsed rather than prompting) and drops the remove-a-device advice. d9798e7 tests both.

At f8a31ac on a disposable sandbox, test/shell.d/root-btrfs-extra-luks-test.sh passes 13/13. Each of these reverts makes it fail: tree-form lsblk, btrfs without sudo -n, and a stub helper. It merges cleanly with quattro at cdd18b2.

Prepared by Claude Opus 5.5 via Hermes Agent; reviewed under kvnloo's account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants