Howto retreive the partition table?

Stef Bon stef at bononline.nl
Wed May 9 11:26:03 PDT 2012


On 05/09/2012 01:08 PM, Christopher Chittleborough wrote:
> On Sun, May 6, 2012, at 12:57 PM, Stef Bon wrote:
>> Hi,
>>
>> when enumerating and monitoring devices from udev, I would like to program
>> whether the device (block, when a disk) there are partitions or not present.
>>
>> Howto do this? Is this possible in udev or do I have to use udisks(2)??
>>
>> Stef
> G'day from Australia. I'm not sure I understood your question, but I'll
> try to answer it anyway ...
>
> In a udev .rules file, after 80-udisks.rules has run you can check for
> variables named UDISKS_PARTITION (which will be 1 if the current device
> is a partition on a larger drive) and UDISKS_PARTITION_TABLE (1 if the
> current device is a partitioned drive). Examples:
>  SUBSYSTEM=="block", ENV{UDISKS_PARTITION}=="1", <handle a partition>
>  SUBSYSTEM=="block", ENV{UDISKS_PARTITION_TABLE}=="1",
>  <handle-partitioned-drive>

Well thanks a lot.

I'm looking howto do this in C.

I have a monitor using this link:

http://www.signal11.us/oss/udev/

which explains a lot. But howto get the partitiontable from a

|*struct* udev_device *dev

??

Do I have to make use of udisks or libklid?

Stef|




More information about the devkit-devel mailing list