Skip to contentSkip to conversation

liblvm IOCTL/sysfs interface

linux-lvm Sandeep K Sinha 4 participants 5 messages Mar 19, 2009

lore
Share & tools
lore
#0 lore raw

Hi all,

I would like to know if there is any means currently to know the complete geometry of a LVM volume.
e.g, If a volume has 3 PV(targets).

So, we should be able to extract some information like.

Name of Volume.
Name of Volume Group.
Name, Range and size for each of the Physical devices involved.

I execute the following steps.

1. pvcreate /dev/sda5 /dev/sda6
2. vgcreate vg /dev/sda5 /dev/sda6
3. lvcreate vg -L 5G

So, I should see the information like.

lvol0
vg
target1 - /dev/sda5 ---- 0 -- 10000 ( BEGIN -- Length ) target2 - /dev/sda6 ---- 10001 -- 4000

We do maintain these informations inside the kernel, We should atleast have an ioctl or sysfs based interface to extract
these information.

Liblvm is under development, won't it be of a good use to provide such a functionality.

Kindly suggest.

Signature · 9 lines
Regards,
Sandeep.





 	
�To learn is to change. Education is a process that changes the learner.�
#1 lore raw
Quoted 6 lines · Sandeep K Sinha

So, I should see the information like.

lvol0
vg
target1 - /dev/sda5 ---- 0 -- 10000 ( BEGIN -- Length ) target2 - /dev/sda6 ---- 10001 -- 4000

dmsetup table

Quoted 7 lines

We do maintain these informations inside the kernel, We should atleast have an ioctl or sysfs based interface to extract
these information.

Liblvm is under development, won't it be of a good use to provide such a functionality.

This is a lower level than liblvm targets (liblvm will work in terms of "LVM level" objects; pvs, vgs, lvs). The functionality to observe and manipulate the targets used by a specific LVM device is already provided by libdevmapper and the dmsetup tool.

Regards,
Bryn.

#2 lore raw

Location as well as size is given by

lvdisplay --maps

Larry Dickson
Cutting Edge Networked Storage

Quoted 34 lines · Bryn M. Reeves
Quoted 6 lines · Sandeep K Sinha

So, I should see the information like.

lvol0
vg
target1 - /dev/sda5 ---- 0 -- 10000 ( BEGIN -- Length ) target2 - /dev/sda6 ---- 10001 -- 4000

dmsetup table

Quoted 7 lines

We do maintain these informations inside the kernel, We should atleast have an ioctl or sysfs based interface to extract
these information.

Liblvm is under development, won't it be of a good use to provide such a functionality.

This is a lower level than liblvm targets (liblvm will work in terms of "LVM level" objects; pvs, vgs, lvs). The functionality to observe and manipulate the targets used by a specific LVM device is already provided by libdevmapper and the dmsetup tool.

Regards,
Bryn.

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#3 lore raw
In reply to Sandeep K Sinha
Quoted 7 lines

I would like to know if there is any means currently to know the complete geometry of a LVM volume.
e.g, If a volume has 3 PV(targets).
So, we should be able to extract some information like.
Name of Volume.
Name of Volume Group.
Name, Range and size for each of the Physical devices involved.

[...]

Quoted 3 lines

We do maintain these informations inside the kernel, We should atleast have an ioctl or sysfs based interface to extract
these information.

Actually, IIUC only part of this info is kept in the kernel. Intuitively, I'd expect that only the set of LVs, along with their size (and mapping to physical blocks) is kept in the kernel, whereas all the names are not, and neither are the volume groups.

Stefan

#4 lore raw
Quoted 8 lines · Stefan Monnier
Quoted 7 lines

I �would like to know if there is any means currently to know the complete geometry of a LVM volume.
e.g, If a volume has 3 PV(targets).
So, we should be able to extract some information like.
Name of Volume.
Name of Volume Group.
Name, Range and size for each of the Physical devices involved.

[...]

Quoted 9 lines
Quoted 3 lines

We do maintain these informations inside the kernel, We should atleast have an ioctl or sysfs based interface to extract
these information.

Actually, IIUC only part of this info is kept in the kernel. Intuitively, I'd expect that only the set of LVs, along with their size (and mapping to physical blocks) is kept in the kernel, whereas all the names are not, and neither are the volume groups.

Thats true. We only meant the target and maps related informations.

Quoted 9 lines

� � � �Stefan

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Signature · 9 lines
Regards,
Sandeep.





 	
�To learn is to change. Education is a process that changes the learner.�