Skip to content

Btrfs migration 1: subvolume foundation#95

Merged
alchark merged 4 commits into
devfrom
btrfs-foundation
Jul 1, 2026
Merged

Btrfs migration 1: subvolume foundation#95
alchark merged 4 commits into
devfrom
btrfs-foundation

Conversation

@Yury-MonZon

@Yury-MonZon Yury-MonZon commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

First part of the btrfs migration. Establishes the btrfs root and a single-root subvolume layout.

  • Subvolume scheme (@, @home, @var-log, @var-cache, @snapshots, boot) with per-subvolume mount options; /boot kept uncompressed so U-Boot can read the kernel/dtb/initrd regardless of its btrfs zstd support.
  • NODATACOW on the systemd journal directory to avoid btrfs CoW fragmentation.
  • /.snapshots left unmounted at runtime for safety.
  • Read-only "Factory Image" snapshot of @ taken once rootfs and kernel are deployed.
  • BLS devicetreedir path resolution fixed so U-Boot picks the correct DTB on a subvolume root.
  • btrfs-compsize tooling.

Stack (merge bottom-up)

@Yury-MonZon Yury-MonZon requested a review from a team June 30, 2026 20:08
@Yury-MonZon Yury-MonZon changed the title Btrfs foundation Btrfs migration 1: subvolume foundation Jun 30, 2026
Comment thread overlays/configs/kernel/install.d/90-loaderentry.install Outdated
Comment thread debian-rk3576-img.yaml Outdated
Comment thread debian-rk3576-img.yaml
Comment thread debian-rk3576-img.yaml Outdated
Comment thread debian-rk3576-ospack.yaml
Comment thread overlays/configs/kernel/install.d/90-loaderentry.install
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.
@alchark alchark merged commit 5152965 into dev Jul 1, 2026
6 checks passed
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.

2 participants