Skip to content

Keep nested subvolume paths intact during snapshot restore - #20876

Open
Cynnamoroll wants to merge 1 commit into
omacom:quattrofrom
Cynnamoroll:contributions/backup-wave2-7541
Open

Cynnamoroll wants to merge 1 commit into
omacom:quattrofrom
Cynnamoroll:contributions/backup-wave2-7541

Conversation

@Cynnamoroll

Copy link
Copy Markdown
Contributor

What changes

The systemd-boot restore journal separates nested subvolume paths with colons, but the initramfs hook splits the list on spaces when applying or undoing a restore. A child such as vm images is treated as two children: apply aborts, and interrupted-restore rollback can leave the moved child in the staged root instead of returning it to the original. Read one path at a time in both directions without changing the journal format.

Follow-up to #19667.

Verification

  • Exercised the real initramfs apply and rollback functions with BusyBox ash 1.36.1 using scratch directories, the real journal reader, and stand-ins for Btrfs UUIDs and subvolume identity. With the unchanged hook, apply stopped at vm is missing from the old root. With only apply fixed, the fixture reached rollback and showed that the child did not return to the original root. With both sides fixed, apply and rollback each succeeded twice, and both children, including vm images/guest.img, ended back in the original root.
  • bash test/shell.d/boot-restore-commit-test.sh (7 passing), bash test/shell.d/boot-sync-test.sh (9 passing), and bash test/shell.d/boot-initcpio-sync-test.sh (11 passing).
  • BusyBox ash -n for the hook, bash -n for the test, and git diff --check passed. These are focused fixture tests, not an end-to-end boot. No booted initramfs, real Btrfs restore, EFI writes, host mounts, or physical-device tests. The existing journal format's colon separator is unchanged.

Screenshots

No visible change: this corrects path parsing in the initramfs restore and rollback routines; it does not change the restore screen.

Read each path from the restore journal without splitting on spaces.
Use the same reader when rolling back an interrupted restore so a
moved child goes back to the original root.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

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

Summary

Keeps nested subvolume paths intact during snapshot restore and rollback.

  • Snapshot restores keep spaces inside nested subvolume paths.

Reviews (2) · Last reviewed commit: "Keep nested subvolume paths intact durin..." · Reviewed by Greptile

@chessing234

Copy link
Copy Markdown
Contributor

@dhh @omarchybot keeping nested subvolume paths on snapshot restore, including names with spaces, is in #21027, with the restore commit tests. It shares omarchy-boot-sync with the deleted-snapshot pin drop (#20278).

Please consider closing this as superseded only after #21027 is accepted. Leaving the close to you.

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Dec 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6.2 Sol High in Codex reviewed ec1504800d. On an Omarchy ISO worker, the initramfs hook split var/lib/vm images on quattro and with the fix reverted. At this head, repeated restore and interrupted rollback preserved the original Btrfs subvolume UUID and contents. The CLI suite and all 27 focused boot checks passed.

Opus 5.5 High and muse-wonder via pi (thinking high) agreed the fix was proportionate and found no actionable defects. Their agreement may draw on the same evidence, and review independence is unconfirmed. #21027 includes the identical hook change and regression test. This PR awaits maintainer review of the boot change and approval for the Tests workflow.

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants