libblkid: newbie question about enabling whole disk sysfs probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
 I am new to util-linux and working on adding some intelligence into
mkswap to be
aware of the underlying device properties.

I want to understand how to discover a sysfs property of a disk, when
mkswap is actually
invoked with a partition id of that disk.

If a new probe is invoked with these calls set, and mkswap is invoked
on the "whole disk" /dev/sdb

       blkdid_probe pr = new_prober(fd);
       blkid_probe_enable_superblocks(pr, 1);
       blkid_probe_enable_partitions(pr, 1);
       blkid_probe_set_superblocks_flags(pr, BLKID_SUBLKS_MAGIC);
       blkid_probe_enable_topology(pr, 1);

I am able to get to the property value (which is set from the sysfs
value for the disk).

But when mkswap is invokded with /dev/sdbX, then sysfs_probe is not
able to discover the parent disk's sysfs property.

Obviously it's easy to do string manipulation and invoke the probe for
the whole disk
in the latter case, I am assuming there is a library interface that'll
do the trick.
Any help would be great.

Thanks,
Venkat.
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux