Repository navigation
Support bcachefs in filesystem installs and updates - #2661
Open
snizovtsev wants to merge 4 commits into
Open
snizovtsev wants to merge 4 commits into
snizovtsev wants to merge 4 commits into
Conversation
install to-filesystem rejects bcachefs roots as an unknown filesystem. Recognize bcachefs so externally prepared roots can use this installation path. Treat fs-verity as unsupported, as for XFS; sealed composefs images remain unsupported. Keep install to-disk unsupported and reject bcachefs before partitioning or formatting. Automatic bcachefs formatting is not implemented, and GRUB installations require a separate /boot on a filesystem GRUB can read. Assisted-by: AI Related: bootc-dev#2341 Signed-off-by: Sergei Nizovtsev <snizovtsev@gmail.com>
Multi-device bcachefs mounts expose a colon-separated source. Passing strings such as `/dev/nvme0n1p1:/dev/sda:/dev/sdb` directly to lsblk prevents bootc from discovering the backing devices. Resolve each member separately and search their disks when locating an ESP. For installation paths that require one representative device, prefer a member whose disk has an ESP. Aggregate read-only flags across the resolved members. Enumerate all ZFS pool members as well, so ESP discovery is not limited to the first device listed by zpool. Allow unresolved ZFS leaves, such as file vdevs, when another block device can be resolved. Single-device filesystems resolve exactly as before. Assisted-by: AI Related: bootc-dev#2341 Signed-off-by: Sergei Nizovtsev <snizovtsev@gmail.com>
findmnt derives a filesystem UUID from a single source device. For a
multi-device bcachefs mount the source is a colon-separated list such as
`/dev/vda:/dev/vdb:/dev/vdc2`, so findmnt reports no UUID and
`install to-filesystem` stops with:
error: Installing to filesystem: No filesystem uuid found in target root
Every member of the filesystem carries its UUID. When findmnt has none
for a bcachefs root, take it from the backing devices, so the
default `root=UUID=...` argument can be written as for other filesystems.
Assisted-by: AI
Related: bootc-dev#2341
Signed-off-by: Sergei Nizovtsev <snizovtsev@gmail.com>
Format three loop devices as one bcachefs filesystem, with the only ESP on the disk of the last one, and run `install to-filesystem` on it. The mount source is then `/dev/loop0:/dev/loop1:/dev/loop2p2`, so the install only succeeds if bootc resolves the devices one by one, finds the ESP on the third disk and takes the root UUID from the devices; the test checks the boot entries on that ESP for `root=UUID=`. The test runs with the composefs backend and systemd-boot only: there the kernels and the boot entries are on the ESP, so no bootloader has to read bcachefs. bcachefs is not in the mainline kernel: without the module or bcachefs-tools the test is skipped. Assisted-by: AI Related: bootc-dev#2341 Signed-off-by: Sergei Nizovtsev <snizovtsev@gmail.com>
This branch has not been deployed
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.
I've been running bootc with Arch Linux and bcachefs on my home desktop,
which is my main workstation, for a few months. This PR brings support for
existing bcachefs roots, including multi-device filesystems, into bootc.
Related to #2341.
The changes resolve each backing device, search their disks for an ESP,
and recover the filesystem UUID when findmnt cannot provide it. The shared
device discovery also searches all ZFS pool members instead of only the
first one.
Scope
This supports storage prepared outside bootc.
install to-diskstillrejects bcachefs before partitioning or formatting and directs users to
install to-filesystem. bcachefs is commonly used across multiple devicesand offers many formatting options. I'd rather leave those storage layout
and formatting choices to the user than add that complexity to bootc.
GRUB installations need a separate
/booton a filesystem GRUB can read,and a bootupd built against the blockdev crate from this branch: bootupd
0.2.34 as released stops on the colon-separated source. With systemd-boot,
the kernels and boot entries are on the ESP.
Runtime filesystem capability detection, also requested in #2341, is
outside this PR's scope. ZFS installation support will be submitted
separately; this PR includes only the shared device discovery changes.
Testing
I asked for extensive QEMU testing of installation and subsequent updates,
including the paths that previously failed on multi-device roots. The
bcachefs tests used UEFI, three virtio disks and bcachefs-tools 1.39.7, with
the root on
/dev/vda:/dev/vdb:/dev/vdc2and the only ESP on the third disk:install to-filesystemwithout--root-mount-spec, boot,bootc switch,bootc upgradeandbootc rollback, with reboots between operations. ESP discovery was alsochecked with
LoaderDevicePartUUIDhidden to exercise the fallback search./boot: install, boot,bootc switchandbootc rollback, with reboots between operations."No filesystem uuid found in target root" without the UUID fix. It skips
environments without the bcachefs module or tools.
AI assistance and human review
Most of the implementation was developed by Claude and reviewed by Astra.
I manually read and understand the code being submitted, directed the QEMU
testing above, and requested three or four rounds of cleanup and style
changes before publishing. This work supports my main workstation, and
I've put substantial time into reviewing both the implementation and its
behavior. My few months of daily use provide the motivation and operational
context; the tests above describe the validation of this patch series.