install: Pass explicit filesystem type to mount after mkfs#2153
Open
jeckersb wants to merge 1 commit intobootc-dev:mainfrom
Open
install: Pass explicit filesystem type to mount after mkfs#2153jeckersb wants to merge 1 commit intobootc-dev:mainfrom
jeckersb wants to merge 1 commit intobootc-dev:mainfrom
Conversation
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>
Contributor
There was a problem hiding this comment.
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.
ckyrouac
approved these changes
Apr 21, 2026
Contributor
|
Direct link to util-linux commit: util-linux/util-linux@8bdc2546d |
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.
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