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

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

 



On Mon, 3 Jan 2022, Roland wrote:

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

You might find this script enlightening:

https://github.com/sdgathman/lbatofile

It maps bad sectors to partition,LV,file,etc

The relevant function for your question is findlv()
Some of the commands run are:

pvdisplay --units k -m '/dev/lvm_pv'
pvs --units k -o+pe_start '/dev/lvm_pv'

Am 03.01.22 um 00:12 schrieb Andy Smith:
 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 ?
_______________________________________________
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