Skip to content

install: Pass explicit filesystem type to mount after mkfs#2153

Open
jeckersb wants to merge 1 commit intobootc-dev:mainfrom
jeckersb:mount_typed
Open

install: Pass explicit filesystem type to mount after mkfs#2153
jeckersb wants to merge 1 commit intobootc-dev:mainfrom
jeckersb:mount_typed

Conversation

@jeckersb
Copy link
Copy Markdown
Collaborator

When mounting a freshly-created filesystem during install, pass
-t to mount rather than relying on auto-detection.

util-linux 2.42 introduced an optimization (commit 8bdc2546d) where
libmount reads device properties from the udev database instead of
probing the device superblock with libblkid. When mkfs runs inside a
container, the udev database is stale for the filesystem type because
mkfs does not generate a kernel uevent — udev only re-probes devices
on kernel-generated events (such as partition table changes from
sfdisk), not on arbitrary block device writes. As a result, the udev
database has partition tags (PARTUUID, PARTLABEL) from sfdisk but
lacks ID_FS_TYPE. libmount's read_from_udev() returns success after
finding those partition tags, so the libblkid direct-probe fallback
is never called. Without a filesystem type, mount falls back to
iterating /etc/filesystems and /proc/filesystems, which fails for
filesystem modules (like xfs with CONFIG_XFS_FS=m) that are not yet
loaded.

Since bootc already knows the filesystem type (it just ran mkfs),
passing -t avoids the auto-detection path entirely.

Closes: #2148
Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: John Eckersberg jeckersb@redhat.com

When mounting a freshly-created filesystem during install, pass
-t <fstype> to mount rather than relying on auto-detection.

util-linux 2.42 introduced an optimization (commit 8bdc2546d) where
libmount reads device properties from the udev database instead of
probing the device superblock with libblkid. When mkfs runs inside a
container, the udev database is stale for the filesystem type because
mkfs does not generate a kernel uevent — udev only re-probes devices
on kernel-generated events (such as partition table changes from
sfdisk), not on arbitrary block device writes. As a result, the udev
database has partition tags (PARTUUID, PARTLABEL) from sfdisk but
lacks ID_FS_TYPE. libmount's read_from_udev() returns success after
finding those partition tags, so the libblkid direct-probe fallback
is never called. Without a filesystem type, mount falls back to
iterating /etc/filesystems and /proc/filesystems, which fails for
filesystem modules (like xfs with CONFIG_XFS_FS=m) that are not yet
loaded.

Since bootc already knows the filesystem type (it just ran mkfs),
passing -t avoids the auto-detection path entirely.

Closes: bootc-dev#2148
Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
@github-actions github-actions Bot added the area/install Issues related to `bootc install` label Apr 21, 2026
@bootc-bot bootc-bot Bot requested a review from ckyrouac April 21, 2026 13:53
Copy link
Copy Markdown
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 introduces a new mount_typed function in the mount crate, which allows for mounting devices with an explicit filesystem type. This change is aimed at improving reliability in container environments where filesystem auto-detection might fail. The installation logic in baseline.rs has been updated to utilize this new function for mounting both the root and boot filesystems. I have no feedback to provide.

@travier
Copy link
Copy Markdown
Contributor

travier commented Apr 21, 2026

Direct link to util-linux commit: util-linux/util-linux@8bdc2546d

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.

xfs mount failure on rawhide

3 participants