Mapping LVs to physical device

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

 




I have a requirement to be able to work out which areas of a physical device assigned to LVM are being used by various logical volumes. I haven't found any easy way to do this using an API, so I've resorted to spawning off lvm commands and interpretting the output.

I can use lvdisplay to map logical extents to physical extents, but I still need to know where the extents start on the physical device, and I can't find a good way of doing that.

pvck tells me the offset and the size of the metadata, and assuming that the first extent starts after the metadata seems to work. But pvck doesn't seem to be present in older versions of LVM (or one of my systems starts running them gets killed), and the help implies its doing some checks too (and lengthly checks would be bad in my application).

Is there a better way to map the Logical Block Addresses of LVs to physical disks?

Chris Farey

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

[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux