-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mount: Leverage udev db #254
mount: Leverage udev db #254
Conversation
@marcin-github Would it be possible for you to try this out? |
src/commands/cmd_mount.rs
Outdated
.scan_devices()? | ||
.filter_map(|dev| dev.devnode().map(ToOwned::to_owned)) | ||
.map(|dev| (dev.clone(), read_super_silent(&dev))) | ||
.filter_map(|(dev, sb)| sb.ok().map(|sb| (dev, sb))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're doing a lot of similar-ish read_super_silent() loops. Maybe we could add a few one-two line helpers with more descriptive names to clean things up?
has_bcachefs_sb()
bcachefs_sb_uuid()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into this, thanks
Something is not going well and reliable. After reboot all device fses mounted but one. I can't mount it also manualy:
I looked into udev db, in file When I run fsck on /dev/vg-ZA1C3NKP/burp I got:
maybe this is why udev didn't detect bcachefs on this device? (I'm on Ggentoo, without systemd...) |
According to talk on irc:
|
@marcin-github I built blkid with static linkage to libblkid
Please give this a try and let me know if it correctly identifies your block device, thanks! |
@tasleson I tried attached blkid, no change:
|
Another debug output of old fs:
|
@marcin-github Change submitted upstream to address blkid, ref. util-linux/util-linux#3001 |
2cd86b2
to
3fbe040
Compare
@marcin-github This updated PR adds an env. variable so you can do things like: BCACHEFS_BLOCK_SCAN=1 bcachefs mount /dev/sda /mnt and get the same behavior you get today with it walking all the block devices. |
@marcin-github If you could try this change out, I think it should work for you, although you'll need to set the env. variable for BCACHEFS_BLOCK_SCAN=1 , thanks! |
c4f3afa
to
4a9c0ea
Compare
If the udev database contains information about bcachefs, utilize it. Otherwise, resort to traversing block devices and checking for bcachefs super blocks. V2: Reduce number of places we call read_super_slient in interators Signed-off-by: Tony Asleson <[email protected]>
Introduce an env. variable for users that have a broken blkid which renders the udev db as incomplete. Only checks for the existence of the variable, not its value. Signed-off-by: Tony Asleson <[email protected]>
If the user passes a single device node during the mount and we have no information for it in the udev db, we read up the super block. When we do this, if the FS only has 1 block device we will simply go ahead and do the mount instead of walking all the block devices and reading up super blocks looking for devices with a matching FS UUID. Signed-off-by: Tony Asleson <[email protected]>
Signed-off-by: Tony Asleson <[email protected]>
4a9c0ea
to
128b569
Compare
If the udev database contains information about bcachefs, utilize it. Otherwise, resort to traversing block devices and checking for bcachefs super blocks.
With this change we no longer get messages like:
when we mount with
UUID=a2c2edcd-9ec6-4067-a648-45cb77006bf9
or with a single device node. This is because we are only trying to read up the super block when we already know that the device has one.Tests tried for two device FS