blockdev: use blkid instead of lsblk for querying all filesystems#813
Merged
jlebon merged 1 commit intocoreos:mainfrom Apr 22, 2022
Merged
blockdev: use blkid instead of lsblk for querying all filesystems#813jlebon merged 1 commit intocoreos:mainfrom
jlebon merged 1 commit intocoreos:mainfrom
Conversation
jlebon
reviewed
Apr 19, 2022
Member
jlebon
left a comment
There was a problem hiding this comment.
One optional comment, but LGTM overall! For the commit message, can you add the rationale in the body, and for the commit title, use something like blockdev: use blkid instead of lsblk for querying all filesystems?
b8c7de7 to
17f9769
Compare
`blkid` can return the filesystem label when `lsblk` doesn't. This may help with coreos/fedora-coreos-tracker#1105.
jlebon
approved these changes
Apr 22, 2022
Member
jlebon
left a comment
There was a problem hiding this comment.
LGTM! I just added the same rationale in the first comment to the commit message.
| ); | ||
| } | ||
|
|
||
| #[test] |
Member
There was a problem hiding this comment.
Awesome, thanks for adding these tests!
jlebon
added a commit
to jlebon/coreos-installer
that referenced
this pull request
Jan 19, 2023
By default, `blkid` will return cached data, which we don't want because it might be stale. Add `-p` to make sure we always bypass the cache. We originally used `lsblk` here which uses the udev database, but this was changed in coreos#813 because it failed to return the filesystem label in some instances. It might be worth revisiting this at some point and find out if we were just missing a `udevadm settle` somewhere. See also: coreos/fedora-coreos-config#2181 (comment)
jlebon
added a commit
to jlebon/coreos-installer
that referenced
this pull request
Jan 19, 2023
By default, `blkid` will return cached data, which we don't want because it might be stale. Add `-p` to make sure we always bypass the cache. We originally used `lsblk` here which uses the udev database, but this was changed in coreos#813 because it failed to return the filesystem label in some instances. It might be worth revisiting this at some point and find out if we were just missing a `udevadm settle` somewhere. See also: coreos/fedora-coreos-config#2181 (comment)
jlebon
added a commit
to jlebon/coreos-installer
that referenced
this pull request
Jan 20, 2023
By default, `blkid` will return cached data, which we don't want because it might be stale. We need to use`-p` to make sure it directly probes the block devices and bypasses the cache. With `-p`, `blkid` requires passing the devices directly. Call it once to gather the list of devices (we trust the cache enough for this) and then again with `-p`. We originally used `lsblk` here which uses the udev database, but this was changed in coreos#813 because it failed to return the filesystem label in some instances. It might be worth revisiting this at some point and find out if we were just missing a `udevadm settle` somewhere. See also: coreos/fedora-coreos-config#2181 (comment)
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.
blkidusage may help with coreos/fedora-coreos-tracker#1105 , as it returns properLABELwhenlsblkdoesn't