Skip to content

bootc install to-filesystem fails to find PReP partition #2220

@supakeen

Description

@supakeen

I think there's some back-and-forth and shared code between bootupd and bootc here. It seems the fix was added in bootc 1.15.2 but bootupd requires bootc-internal-blockdev = "1.15.1"; perhaps we need an updated bootupd? A dependabot PR for that is open: coreos/bootupd#1102


I have the following setup of devices and partitions mounted to /run/osbuild/mounts. When calling bootc install to-filesystem ... /run/osbuild/mounts it errors out unable to find the PReP partition. I think the following PRs and issues are related:

  1. Blockdev cleanup #2000 initial change to partition scanning?
  2. buildroot: bind mount /run/udev for partition discovery osbuild/osbuild#2428 discussion about exposing udev in osbuild which was determined to not be a good idea.
  3. blockdev: Fall back to blkid -p when udev is unavailable #2169 fallback implementation using blkid in bootc.

Here is some additional information of what I see; all of these commands are executed inside the bubblewrap sandbox that osbuild runs bootc in. We are running bootc 1.15.2.

This was reported to us by the COPR folks through: osbuild/bootc-image-builder#1223 and I've asked the CoreOS folks to confirm and they see the same issue.

bootc has definitely found the appropriate loopback device and the loopback device seems to contain all the necessary information.

bash-5.3# fdisk -l /dev/loop0
Disk /dev/loop0: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 5E498532-F66F-45F7-856C-3947540949ED

Device         Start      End  Sectors Size Type
/dev/loop0p1    2048    10239     8192   4M PowerPC PReP boot
/dev/loop0p2   10240  2107391  2097152   1G Linux filesystem
/dev/loop0p3 2107392 20971486 18864095   9G Linux filesystem

The exact call I think bootc 1.15.2 is using to find things returns the correct GUID.

bash-5.3# blkid -p -o export /dev/loop0p1
DEVNAME=/dev/loop0p1
PART_ENTRY_SCHEME=gpt
PART_ENTRY_UUID=e13d84b4-c453-4c9f-9bcd-9661b864a68b
PART_ENTRY_TYPE=9e1a2d38-c612-4316-aa26-8b49521e5a8b
PART_ENTRY_NUMBER=1
PART_ENTRY_OFFSET=2048
PART_ENTRY_SIZE=8192
PART_ENTRY_DISK=7:0

When calling bootc install to-filesystem ... I get the following error:

bootc install to-filesystem --source-imgref containers-storage:[overlay@/run/osbuild/containers/storage2+/run/containers/storage:additionalimagestore=/run/osbuild/containers/storage]23d96bab9abd0129245c0dd2208361191a0535f0915842152f98fc922898c761 --skip-fetch-check --generic-image --karg rw --karg console=tty0 --karg console=ttyS0 --target-imgref quay.io/fedora/fedora-bootc:latest /run/osbuild/mounts
Installing image: docker://quay.io/fedora/fedora-bootc:latest
Initializing ostree layout
layers already present: 0; layers needed: 65 (927.5 MB)
Deploying container image...done (38 seconds)
Bootloader: grub
Installing bootloader via bootupd
error: boot data installation failed: installing component BIOS to device /dev/loop0: installing GRUB on /dev/loop0: Failed to find PReP partition with GUID 9E1A2D38-C612-4316-AA26-8B49521E5A8B
error: Installing to filesystem: Installing bootloader: Failed to run command: Command {
    program: "bwrap",
    args: [
        "bwrap",
        "--bind",
        "/run/osbuild/mounts/ostree/deploy/default/deploy/51899f2ccb49f3b456dce76b8e467f446f87586945686a915026aac8a707addf.0",
        "/",
        "--proc",
        "/proc",
        "--dev-bind",
        "/dev",
        "/dev",
        "--bind",
        "/sys",
        "/sys",
        "--tmpfs",
        "/run",
        "--bind",
        "/run",
        "/run",
        "--bind",
        "/run/osbuild/mounts/boot",
        "/boot",
        "--bind",
        "/run/osbuild/mounts",
        "/sysroot",
        "--setenv",
        "PATH",
        "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
        "--",
        "bootupctl",
        "backend",
        "install",
        "--write-uuid",
        "--filesystem",
        "/",
        "/",
    ],
    create_pidfd: false,
}

Additional (potentially not very useful) bits:

bash-5.3# blkid -o full
/dev/loop0p3: LABEL="root" UUID="aa3cff58-c8e4-4794-84b2-89d127f4a523" BLOCK_SIZE="512" TYPE="xfs" PARTUUID="27ad1867-5325-4e23-90fa-dc960c625664"
/dev/loop0p2: LABEL="boot" UUID="a2d17c6c-de8c-49e1-abc0-96614494e955" BLOCK_SIZE="512" TYPE="xfs" PARTUUID="3c8b17a4-3ca4-47e3-aa72-ee510159a851"
/dev/loop0p1: PARTUUID="e13d84b4-c453-4c9f-9bcd-9661b864a68b"
bash-5.3# findmnt -R /run/osbuild/mounts
TARGET                     SOURCE       FSTYPE OPTIONS
/run/osbuild/mounts        /dev/loop0p3 xfs    rw,nosuid,nodev,relatime,seclabel,inode64,logbufs=8,logbsize=32k,noquota
`-/run/osbuild/mounts/boot /dev/loop0p2 xfs    rw,nosuid,nodev,relatime,seclabel,inode64,logbufs=8,logbsize=32k,noquota
bash-5.3# bootc --version
bootc 1.15.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions