linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] deleted LV recovery: understanding metadata format and determining LV extents
@ 2015-01-10 18:12 Thanos Makatos
       [not found] ` <1420926501.92697.YahooMailBasic@web181504.mail.ne1.yahoo.com>
  2015-01-11 17:33 ` Alasdair G Kergon
  0 siblings, 2 replies; 4+ messages in thread
From: Thanos Makatos @ 2015-01-10 18:12 UTC (permalink / raw)
  To: linux-lvm@redhat.com

Hi, I'm working on a case where a bunch of logical volumes were deleted but now we need them back. We have disabled archives and back ups in lvm.conf. They way I am trying to approach the problem is to examine LVM's metadata (the first MB of the block device) and determine whether the extents used by these logical volumes have been assigned to other logical volumes.

I am developing a script (which I hope to upstream) that does that however I need some clarification regarding the meaning of some of the metadata. I have focused on the list of segments in each logical volume definitation but I don't know how to interpret the "stripes" member. These are all linear LVs.

What is this "stripes" member and how is it related to "start_extent" and "extent_count"?
E.g. I have the following two LV definitions (the rest of the metadata is ommitted):

		foo {
			id = "..."
			status = ["READ", "WRITE", "VISIBLE"]
			flags = []
			segment_count = 1
			
			segment1 {
				start_extent = 0
				extent_count = 2
				
				type = "striped"
				stripe_count = 1 # linear
				
				stripes = [
				"pv0", 306705
				]
			}
		}

		bar {
			id = "..."
			status = ["READ", "WRITE", "VISIBLE"]
			flags = []
			segment_count = 9

                        # segments 1-8 ommitted

			segment9 {
				start_extent = 59162
				extent_count = 3662
				
				type = "striped"
				stripe_count = 1 # linear
				
				stripes = [
				"pv0", 246616
				]
			}
		}

I thought that the "stripes" is some extent from which the "start_extent" is calculated but I think I'm wrong because the segments of these two LVs overlap. How can I determine which extents are used by each LV?

Any help greatly appreciated.

--
Thanos Makatos

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-11 17:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-10 18:12 [linux-lvm] deleted LV recovery: understanding metadata format and determining LV extents Thanos Makatos
     [not found] ` <1420926501.92697.YahooMailBasic@web181504.mail.ne1.yahoo.com>
2015-01-11 10:47   ` Thanos Makatos
2015-01-11 13:12     ` matthew patton
2015-01-11 17:33 ` Alasdair G Kergon

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