linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Stuart D Gathman <stuart@gathman.org>
To: Marcin Owsiany <marcin@owsiany.pl>
Cc: linux-lvm@redhat.com
Subject: Re: [linux-lvm] Where are the data blocks of an LV?
Date: Tue, 26 Jul 2022 14:22:49 -0400 (EDT)	[thread overview]
Message-ID: <2a509a35-24ab-341e-c6f-51caef2f4e1b@gathman.org> (raw)
In-Reply-To: <CAFsGsxLOyawZH7xxgfLNkh=VftBNAaDStE0XQgQTGf9NmyZ+ZQ@mail.gmail.com>

Checkout https://github.com/sdgathman/lbatofile
It was written to identify the file affected by a bad block (so it goes
the opposite direction), but the getpvmap() function obtains pe_start and 
pe_size plus the list of segments.  findlv() goes through the segments to
find the one an absolute sector is in.  That should tell you what you want 
to know.

On Fri, 22 Jul 2022, Marcin Owsiany wrote:

> I know that it is possible to find where a given logical volume's extents
> start on a PVs thanks to the information printed by lvdisplay --maps.
> 
> I was also able to experimentally establish that the actual data of an LV
> starts one megabyte after that location. Is that offset documented anywhere,
> or can I somehow discover it at runtime for a given LV?

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


      parent reply	other threads:[~2022-07-26 18:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22 17:30 [linux-lvm] Where are the data blocks of an LV? Marcin Owsiany
2022-07-26  8:58 ` Roger James
2022-07-26 18:22 ` Stuart D Gathman [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=2a509a35-24ab-341e-c6f-51caef2f4e1b@gathman.org \
    --to=stuart@gathman.org \
    --cc=linux-lvm@redhat.com \
    --cc=marcin@owsiany.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).