Btrfs migration 1: subvolume foundation#95
Merged
Merged
Conversation
This was referenced Jun 30, 2026
alchark
requested changes
Jul 1, 2026
90e94fc to
46407da
Compare
Define the subvolume layout (@, @home, @var-log, @var-cache, @snapshots, boot) with per-subvolume mount options, keep /boot uncompressed so U-Boot can read the kernel/dtb/initrd, and factor out root device retrieval into a helper. Generate the BLS boot entries, deriving the devicetreedir/overlay prefix from each entry's root subvolume so U-Boot resolves the in-entry paths correctly, with FDT_SUBVOL_PREFIX as an override. Install btrfs-progs and btrfs-compsize.
journald's append-heavy writes fragment badly under btrfs copy-on-write. Pre-create the journal directory with NODATACOW while it is still empty so the journal files written on first boot inherit it.
Once the rootfs and kernel are fully deployed, take a read-only snapshot of @ into .snapshots/@_Factory-Image for rollback. It captures @ only; the nested subvolumes (boot/home/var-*) are separate and excluded.
46407da to
21f3108
Compare
alchark
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First part of the btrfs migration. Establishes the btrfs root and a single-root subvolume layout.
@,@home,@var-log,@var-cache,@snapshots,boot) with per-subvolume mount options;/bootkept uncompressed so U-Boot can read the kernel/dtb/initrd regardless of its btrfs zstd support.NODATACOWon the systemd journal directory to avoid btrfs CoW fragmentation./.snapshotsleft unmounted at runtime for safety.@taken once rootfs and kernel are deployed.devicetreedirpath resolution fixed so U-Boot picks the correct DTB on a subvolume root.btrfs-compsizetooling.Stack (merge bottom-up)
btrfs-foundation->dev(this PR)btrfs-profiles->btrfs-foundationcog-kodi-display->btrfs-profilesbuild-stamping->btrfs-profiles