Skip to content

install: Enable installing to multi device parents#1911

Open
ckyrouac wants to merge 1 commit intobootc-dev:mainfrom
ckyrouac:multiple-backing-devices
Open

install: Enable installing to multi device parents#1911
ckyrouac wants to merge 1 commit intobootc-dev:mainfrom
ckyrouac:multiple-backing-devices

Conversation

@ckyrouac
Copy link
Collaborator

When the root filesystem spans multiple backing devices (e.g., LVM across multiple disks), discover all parent devices and find ESP partitions on each. For bootupd/GRUB, install the bootloader to all devices with an ESP partition, enabling boot from any disk in a multi-disk setup. systemd-boot and zipl only support single-device configurations.

This adds a new integration test validating both single-ESP and dual-ESP multi-device scenarios.

Fixes: #481

Assisted-by: Claude Code (Opus 4.5)

@github-actions github-actions bot added the area/install Issues related to `bootc install` label Jan 14, 2026
@bootc-bot bootc-bot bot requested a review from cgwalters January 14, 2026 19:54
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully enables installing to multi-device parent filesystems, such as LVM spanning multiple disks. It correctly discovers all parent devices and, for bootupd/GRUB, installs the bootloader to all devices with an ESP partition. For bootloaders that only support single-device configurations like systemd-boot and zipl, the implementation correctly defaults to using the first available device. The changes are well-architected, adapting data structures and logic to handle multiple devices. A new, thorough integration test validates both single and dual ESP scenarios. Overall, this is a solid enhancement with good error handling and logging. I have one suggestion to further improve the robustness of ESP detection.

cgwalters
cgwalters previously approved these changes Jan 15, 2026
@ckyrouac ckyrouac force-pushed the multiple-backing-devices branch from f2a175a to f7b1892 Compare January 15, 2026 20:26
@ckyrouac ckyrouac marked this pull request as draft January 15, 2026 20:26
@ckyrouac
Copy link
Collaborator Author

waiting to merge until the patch release goes out

@ckyrouac ckyrouac force-pushed the multiple-backing-devices branch 3 times, most recently from 77b65cb to d03c6fa Compare January 16, 2026 17:31
@HuijingHei
Copy link
Contributor

Maybe this PR could help to consider #1916 ? @ckyrouac

@cgwalters cgwalters force-pushed the multiple-backing-devices branch from d03c6fa to 9b1c313 Compare January 21, 2026 13:08
@ckyrouac ckyrouac force-pushed the multiple-backing-devices branch 2 times, most recently from 6802697 to 081f3b2 Compare January 22, 2026 15:29
@ckyrouac ckyrouac marked this pull request as ready for review January 22, 2026 19:28
@bootc-bot bootc-bot bot requested a review from jeckersb January 22, 2026 19:28
@ckyrouac ckyrouac force-pushed the multiple-backing-devices branch from 081f3b2 to 9d0e284 Compare January 23, 2026 14:53
# See https://tmt.readthedocs.io/en/stable/stories/features.html#reboot-during-test
match $env.TMT_REBOOT_COUNT? {
null | "0" => test_single_esp,
"1" => { test_dual_esp; test_three_devices_partial_esp; tmt-reboot },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about add another test scenario like RAID1 that using the whole disks (see coreos/bootupd#1059), for example:

root@localhost-live:/home/fedora# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
vda         253:0    0   30G  0 disk  
└─md126       9:126  0   30G  0 raid1 
  ├─md126p1 259:0    0  477M  0 part  
  ├─md126p2 259:1    0  954M  0 part  /boot
  └─md126p3 259:2    0 28.6G  0 part  /
vdb         253:16   0   30G  0 disk  
└─md126       9:126  0   30G  0 raid1 
  ├─md126p1 259:0    0  477M  0 part  
  ├─md126p2 259:1    0  954M  0 part  /boot
  └─md126p3 259:2    0 28.6G  0 part  /

To create RAID1 using command:
sudo mdadm -CR /dev/md126 -e 1 -l1 -n 2 /dev/loop0 /dev/loop1 --assume-clean

@ckyrouac ckyrouac force-pushed the multiple-backing-devices branch 2 times, most recently from 541691d to baa6c67 Compare March 24, 2026 19:17
@ckyrouac ckyrouac requested a review from cgwalters March 24, 2026 19:17
@ckyrouac ckyrouac marked this pull request as ready for review March 24, 2026 19:17
@bootc-bot bootc-bot bot requested a review from jmarrero March 24, 2026 19:18
@ckyrouac ckyrouac force-pushed the multiple-backing-devices branch 2 times, most recently from 8f69693 to 1794593 Compare March 25, 2026 11:36
Assisted-by: Claude Code (Opus 4)
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
cgwalters
cgwalters previously approved these changes Mar 25, 2026
Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane to me, I have just nits really that are nonblocking, we can fix in followups too.

BwrapCmd::new(&target_root)
.setenv(
"PATH",
"/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use a shared const for this or perhaps better have set_default_path() on BwrapCmd

CLOUDEOF
fi

# Temporary: update bootupd from @CoreOS/continuous copr until
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit tricky as we probably also want to CI test the case without the new bootupd too...

I know, another matrix entry in theory...

I guess it'll be tested in post submits by the workflow test.

# Test that bootc install to-existing-root can find and use ESP partitions
# when the root filesystem spans multiple backing devices (e.g., LVM across disks).
#
# Five scenarios are tested across three reboot cycles:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're just testing installation to loopback, AFAICS there's no reason to reboot the host.

That said what would be a stronger test here is for us to test these setups probably via Anaconda where we boot into a guest VM with that. I tried to streamline this in bootc-dev/bcvk#202 but yeah it needs a bit of work.

I guess one thing we could do is extend the anaconda stuff we already have here in our integration tests.

Yet a different alternative is we ask tmt to directly support kickstart (and copy over some of the bcvk smarts there re mounting host container storage via virtiofs etc).

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

Labels

area/install Issues related to `bootc install`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bootc install to-existing-root fails with multiple backing devices

3 participants