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

[linux-lvm] Identifying useable block devices



Hi,

when looking at the udev properties of a device mapper node, how can I
decide whether this is a block device that the user can use for creating
filesystems on, etc?

For example, when creating a thinly provisioned logical volume with these
steps

 # vgcreate TEST /dev/loop1
 # lvcreate TEST --thinpool pool -L 80
 # lvcreate -T TEST/pool -n thin -V 100

I end up with a lot of devices:

 # ls /dev/mapper/TEST-*
 /dev/mapper/TEST-pool        /dev/mapper/TEST-pool_tmeta  /dev/mapper/TEST-thin
 /dev/mapper/TEST-pool_tdata  /dev/mapper/TEST-pool-tpool

How can a program tell that only /dev/mapper/TEST-thin can really be
used as a block device, and the rest should be ignored?

Is there a way to do this by looking at "udevadm info", for example?

(What seems to work is skipping all nodes that have
DM_UDEV_IGNORE_DISK_RULES_FLAG set to true.  Is this maybe even
documented somewhere?)

Thanks!


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