udisks2 problem in Guymager - How to get Linux device for drives?

Thomas Gläßle t_glaessle at gmx.de
Wed Oct 28 17:33:38 PDT 2015


Hey,

Guy wrote on 10/28/2015 10:32 PM:
> - Guymager needs to find out the Linux device name for each drive.
> That would be /dev/sda, for example.
>
> - Now comes my problem: How can I find out, which Linux device name
> belongs to which drive? For doing so, I would have to look at the
> block_devices, property "Device" in interface
> org.freedesktop.UDisks2.Block.
>
> However, the only matching criteria I see is the "Drive" property, but
> there are many block_devices with that property: /dev/sda, /dev/sda1,
> /dev/sda2, ...

I'd look for partitions that are not "child" partitions, i.e. the
devices that do not export the Partition interface or have
Partition.Table is set to "/" and Partition.IsContained set to false.

Furthermore, Block.CryptoBackingDevice should be "/", but from my
experience you don't have to worry about that, since UDisks doesn't set
the Block.Drive for unlocked devices (although that might be subject to
change or even just a bug?).

I'm not sure this covers all cases, but at least these are the
properties that I'm currently using in udiskie.

>
> How do I choose the right one? Guymager could maybe take the one with
> the shortest name, but I'm not sure if that really is safe in each and
> every situation and every Linux system. What misses in my eyes is a
> property named "Device" (in the interface
> org.freedesktop.UDisks2.Drive) for the drives under
> /org/freedesktop/UDisks2/drives/...
>
> What do you think?
>
> Thank you in advance!
>
> Guy Voncken
>
>
>
>
> _______________________________________________
> devkit-devel mailing list
> devkit-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/devkit-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/devkit-devel/attachments/20151029/c96fc1b2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/devkit-devel/attachments/20151029/c96fc1b2/attachment.sig>


More information about the devkit-devel mailing list