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

Stuart D Gathman <[email protected]>
Newsgroups gmane.linux.lvm.general
Message-ID <[email protected]>
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
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.