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
Wrong properties after udev change event and missing entries in udev #425
Comments
Relevant downstream bug: https://bugs.launchpad.net/ubuntu/+source/gnome-disk-utility/+bug/1641308 |
Another trigger is just running GParted. So udev is providing udisks2 with ID_PART_ENTRY_* for the extended partition, but it in turn is getting these from libblkid. If I run ...but after triggering a udev change event (by starting GParted) I get: The problem may not be with udev, but in libblkid or beyond. |
|
I was able to reproduce this on Ubuntu 18.04 , but not on Fedora 28 (these have same versions of libblockdev and udisks). I didn't try to reproduce this with GParted (I currently don't have Ubuntu VM with GUI), but if this also happens with GParted, it probably isn't a udisks related bug. On the other hand, this doesn't happen with parted and I also wasn't able to reproduce this with just libblockdev (manually without UDisks), so it looks like UDisks might be at least part of the problem (possibly scanning the disk/partition in a "wrong" time). The error message suggest that something opened the device with an exclusive lock and udev/blkid can't read the device because of that, but according to tl;dr I have no idea if udisks is part of the problem and I'll try to test this more. I'll also try to find some better fallback for the size and partition type for extended partitions to properly set the |
|
GParted isn't necessary to reproduce (and in case I was misunderstood, GParted isn't affected by the bug - it is only a trigger). Here is another test case (using a Ubuntu 18.04 desktop VM):
On a 18.04 server VM, adapting the method above to use parted gives a different result (there are no problems with blkid). I see that parted results in a different TYPE in the output for blkid on the extended partition - 0xf rather than 0x5: [edit: ...these cases are consistent with pothos' original comment] Is gnome-disk-utility using udisks to create the partitions? This method is different to using parted, but shares something in common with the startup (and only the startup - no edits are required) of GParted in terms of seemingly locking the extended partition device. |
|
After getting "No such device or address", I'm able to restore "normal operation" (up to the point of having an extended partition with correct blkid & udisks output, and ignoring data loss) by deleting & recreating the extended partition in gnome-disk-utility. Is that consistent with something locking the extended partition device? |
|
Hey, Maybe this causes the kernel to trigger an event that needs to be triggered in libblockdev after the change (adding it there has no effect after releasing the lock in |
|
The code which works when not run inside UDisks (e.g. directly libblockdev) uses |
|
There are two ways to end up with a zero |
|
I believe it's a misbehavior in the This test also works for loop devices. I will reach out to the people who were involved when this syscall was added, and ask if they agree to have it fixed in the kernel. |
|
Ah, well, there is a |
|
Oh, this has been fixed in libparted master since commit c6dc6e5d in June 2015. However, since there was no release since 2014, the distributions seem to only pick a few fixes. At least for Debian, it does not include the fix for this issue… so, we need to urge the Debian maintainers to include the fix. That explains the failures with Debian and Ubuntu but not on Fedora. |
|
Closing this here as it is a distro issue. |
Most ID_PART_* udev entries for an extended partition (i.e. the container itself) are lost when a new primary partition is created. But because UDisks still wants to set all values anew, it falls back to sysfs entries for only partition number, offset and size. An extended partition will therefore always have the IsContainer set to false (it is not queried in sysfs ) and Size set to 0 because that is the correct entry in sysfs. All contained partitons will therefore disappear in GNOME Disks because there is no container for them.
This behavior can be triggered by creating an empty extended partition and then an empty primary partition through UDisks. I could not get the same result by adding the primary partition with
partedon the command line.Maybe this can be forwarded to udev since the information loss happens there, but it could be that the way udev events are triggered is not allowed.
Initially the extended partiton
udevadm info -q all -n /dev/loop0p2has all ID_PART_* entries (_SIZE, _TYPE etc). But afterwards only ID_PART_TABLE_TYPE and ID_PART_TABLE_UUID remain.The text was updated successfully, but these errors were encountered: