Re: convert logical sector -> physical sector + pv/vg extent number

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

 



thanks!

any chance to get retrieve this information for automated/script based
processing ?

roland


Am 03.01.22 um 00:12 schrieb Andy Smith:
Hi Roland,

On Sun, Jan 02, 2022 at 08:00:30PM +0100, Roland wrote:
if i have a logical sector/block "x" on a lvm logical volume ,  is there
a way to easily calculate/determine (optimally by script/cli) the
corresponding physical sector of the physical device it belongs to and
the extent number of the appropiate pv/vg where it resides ?
lvdisplay --maps /path/to/lv

tells you all the mappings of logical extents within the LV to
physical extents within the PV.

pvdisplay --units s /dev/yourpv | grep 'PE Size'

tells you the size of a physical extent in sectors.

Between those you can work out the sector number on the physical
device for a sector number on a logical volume.

Cheers,
Andy

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



_______________________________________________
linux-lvm mailing list
linux-lvm@xxxxxxxxxx
https://listman.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