archive mirror
 help / color / mirror / Atom feed
From: Andy Smith <>
Subject: Re: [linux-lvm] convert logical sector -> physical sector + pv/vg extent number
Date: Sun, 2 Jan 2022 23:12:42 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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.


linux-lvm mailing list
read the LVM HOW-TO at

  reply	other threads:[~2022-01-03  8:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-02 19:00 [linux-lvm] convert logical sector -> physical sector + pv/vg extent number Roland
2022-01-02 23:12 ` Andy Smith [this message]
2022-01-03 11:13   ` Roland
2022-01-03 16:43     ` Roland
2022-01-06 13:47     ` Stuart D Gathman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).