linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] How to restore a PV ??
@ 2006-10-13  1:27 Jerome
  2006-10-16 15:43 ` Jonathan E Brassow
  2006-10-16 15:57 ` Jerome
  0 siblings, 2 replies; 11+ messages in thread
From: Jerome @ 2006-10-13  1:27 UTC (permalink / raw)
  To: linux-lvm

Hi all,
i've made a mistake on deleting the MBR of a disk who was included in a 
Volume Group of three disks.
Now, when i do a pvdisplay command, i have this result:

  pvdisplay
   2 PV(s) found for VG principal: expected 3
   Logical volume (Database) contains an incomplete mapping table.
   PV segment VG free_count mismatch: 0 != 3576
   PV segment VG extent_count mismatch: 7152 != 10728
   Internal error: PV segments corrupted in principal.

And a vgdisplay show me this following:
vgdisplay
   2 PV(s) found for VG principal: expected 3
   2 PV(s) found for VG principal: expected 3
   Volume group "principal" not found

I'm sure that the data on the hard disk are not erased. But i want to 
restore this third disk, that it is part of the "principal" Volume 
Group. (I have a fourth disk with the same physical caracteristics).
So, how can i do to succeed in this?

Best regards.
-- 
-- J�r�me
Si l'on peut trouver moins que rien, c'est que rien vaut d�j� quelque chose.
	(Raymond Devos)

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

* Re: [linux-lvm] How to restore a PV ??
  2006-10-13  1:27 [linux-lvm] How to restore a PV ?? Jerome
@ 2006-10-16 15:43 ` Jonathan E Brassow
  2006-10-16 15:57 ` Jerome
  1 sibling, 0 replies; 11+ messages in thread
From: Jonathan E Brassow @ 2006-10-16 15:43 UTC (permalink / raw)
  To: LVM general discussion and development

does 'vgcfgrestore principal' work?

  brassow

On Oct 12, 2006, at 8:27 PM, Jerome wrote:

> Hi all,
> i've made a mistake on deleting the MBR of a disk who was included in 
> a Volume Group of three disks.
> Now, when i do a pvdisplay command, i have this result:
>
>  pvdisplay
>   2 PV(s) found for VG principal: expected 3
>   Logical volume (Database) contains an incomplete mapping table.
>   PV segment VG free_count mismatch: 0 != 3576
>   PV segment VG extent_count mismatch: 7152 != 10728
>   Internal error: PV segments corrupted in principal.
>
> And a vgdisplay show me this following:
> vgdisplay
>   2 PV(s) found for VG principal: expected 3
>   2 PV(s) found for VG principal: expected 3
>   Volume group "principal" not found
>
> I'm sure that the data on the hard disk are not erased. But i want to 
> restore this third disk, that it is part of the "principal" Volume 
> Group. (I have a fourth disk with the same physical caracteristics).
> So, how can i do to succeed in this?
>
> Best regards.
> -- 
> -- J�r�me
> Si l'on peut trouver moins que rien, c'est que rien vaut d�j� quelque 
> chose.
> 	(Raymond Devos)
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>

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

* Re: [linux-lvm] How to restore a PV ??
  2006-10-13  1:27 [linux-lvm] How to restore a PV ?? Jerome
  2006-10-16 15:43 ` Jonathan E Brassow
@ 2006-10-16 15:57 ` Jerome
  2006-10-16 19:20   ` Jonathan E Brassow
  1 sibling, 1 reply; 11+ messages in thread
From: Jerome @ 2006-10-16 15:57 UTC (permalink / raw)
  To: LVM general discussion and development

jbrassow wrote:
 >does 'vgcfgrestore principal' work?
 >
 > brassow
 >
Hi Jonathan,
i try to use this command, and i've received this error mesage:

/etc/lvm/backup/principal: stat failed: No such file or directory
Couldn't read volume group metadata.
Restore failed.

I mean that i've lost the /etc/lv/ directory lost. I've read some 
information about how to construct the Metadata file with hexdump 
command (cf : 
https://www.redhat.com/archives/linux-lvm/2006-June/msg00049.html).
But i not sure how to do this yet.

Thank's a lot.




-- 
-- J�r�me
Il n'y a point de g�nie sans un grain de folie.
	(Aristote)

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

* Re: [linux-lvm] How to restore a PV ??
  2006-10-16 15:57 ` Jerome
@ 2006-10-16 19:20   ` Jonathan E Brassow
  2006-11-14 23:00     ` Brian McCullough
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan E Brassow @ 2006-10-16 19:20 UTC (permalink / raw)
  To: LVM general discussion and development

On each disk in the volume group is a record of the changes that have 
been made to the volume group.  The last item in the record is the 
current lvm meta-data.  If you can retrieve that, it is the same as 
having the backup file which would normally be found in 
/etc/lvm/backup.

You could use hexdump, but I find it much simpler to use 'less -f 
<device>'.  You should see something like:

<crap>
principal {
...
}
<comments>
<crap>
principal {
...
}
<comments>
<crap>

You should be able to search for 'principal' (the name of your volume 
group) to locate the first record.  As I said, this "meta data area" of 
the disk keeps a history of your volume group changes.  That is, rather 
than overwriting the record, it writes the new metadata format after 
the last one (in a circular buffer fashion).  You can use the 'seqno' 
field to determine the newest one.  Also, the metadata is written in 
text to the disk, so it should be simple enough to read it and 
determine if everything looks fine.

Once you've found the latest copy of the metadata, copy it - including 
comments - to a file and use 'vgcfgrestore -t -f <file> <vgname>' to 
test it.  Once satisfied, perform the 'vgcfgrestore -f <file> 
<vgname>'.

If all else fails, you can use dd to grab me the first chunk of the 
disk, and I'll recreate the backup file for you.  ('dd if=<one of the 
good devs> of=<output file> bs=1M count=1;  bzip2 <output file>; send 
me <output file>.bz2')

  brassow

On Oct 16, 2006, at 10:57 AM, Jerome wrote:

> jbrassow wrote:
> >does 'vgcfgrestore principal' work?
> >
> > brassow
> >
> Hi Jonathan,
> i try to use this command, and i've received this error mesage:
>
> /etc/lvm/backup/principal: stat failed: No such file or directory
> Couldn't read volume group metadata.
> Restore failed.
>
> I mean that i've lost the /etc/lv/ directory lost. I've read some 
> information about how to construct the Metadata file with hexdump 
> command (cf : 
> https://www.redhat.com/archives/linux-lvm/2006-June/msg00049.html).
> But i not sure how to do this yet.
>
> Thank's a lot.
>
>
>
>
> -- 
> -- J�r�me
> Il n'y a point de g�nie sans un grain de folie.
> 	(Aristote)
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>

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

* Re: [linux-lvm] How to restore a PV ??
  2006-10-16 19:20   ` Jonathan E Brassow
@ 2006-11-14 23:00     ` Brian McCullough
  2006-11-14 23:06       ` Alasdair G Kergon
  0 siblings, 1 reply; 11+ messages in thread
From: Brian McCullough @ 2006-11-14 23:00 UTC (permalink / raw)
  To: LVM general discussion and development

I am having a similar problem with a drive that was created under LVM
version 1.  More questions below.


On Mon, Oct 16, 2006 at 02:20:14PM -0500, Jonathan E Brassow wrote:
> On each disk in the volume group is a record of the changes that have 
> been made to the volume group.  The last item in the record is the 
> current lvm meta-data.  If you can retrieve that, it is the same as 
> having the backup file which would normally be found in 
> /etc/lvm/backup.
> 
> You could use hexdump, but I find it much simpler to use 'less -f 
> <device>'.  You should see something like:
> 
> <crap>
> principal {
> ...
> }
> <comments>
> <crap>
> principal {
> ...
> }
> <comments>
> <crap>


Is this also true for LVM1?  I have examined the disk ( there are 5 LVs
on this disk, one elsewhere ( nowhere! ) ) and it doesn't seem to follow
this format.

If this is not true, is there any way to recover such a Volume Group?

Here is what vgscan and pvscan show:

[root@clachan media]# pvscan
  5 PV(s) found for VG vg_system: expected 6
  Logical volume (lvol4) contains an incomplete mapping table.
  PV segment VG free_count mismatch: 1381 != 2572
  PV segment VG extent_count mismatch: 1417 != 2608
  Internal error: PV segments corrupted in vg_system.
[root@clachan media]# vgscan
  Reading all physical volumes.  This may take a while...
  5 PV(s) found for VG vg_system: expected 6
  5 PV(s) found for VG vg_system: expected 6
  Volume group "vg_system" not found
[root@clachan media]# vgchange -a y --partial vg_system
  Partial mode. Incomplete volume groups will be activated read-only.
  5 PV(s) found for VG vg_system: expected 6
  Logical volume (lvol4) contains an incomplete mapping table.
  PV segment VG free_count mismatch: 1381 != 2572
  PV segment VG extent_count mismatch: 1417 != 2608
  Internal error: PV segments corrupted in vg_system.
  Unable to find volume group "vg_system"


I do have several copies of the config file, also on this drive ( in a
real ext2 partition! ).  Could I just edit the file to remove lvol4 (
with 250 segments! ) and do a vgcfgrestore from an LVM2 system?


Thank you,
Brian

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

* Re: [linux-lvm] How to restore a PV ??
  2006-11-14 23:00     ` Brian McCullough
@ 2006-11-14 23:06       ` Alasdair G Kergon
  2006-11-15  1:32         ` Brian McCullough
  2006-11-17 13:44         ` Brian McCullough
  0 siblings, 2 replies; 11+ messages in thread
From: Alasdair G Kergon @ 2006-11-14 23:06 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, Nov 14, 2006 at 06:00:03PM -0500, Brian McCullough wrote:
>   Internal error: PV segments corrupted in vg_system.

First update your lvm2 software to avoid that bug: you shouldn't
see internal errors!

Alasdair
-- 
agk@redhat.com

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

* Re: [linux-lvm] How to restore a PV ??
  2006-11-14 23:06       ` Alasdair G Kergon
@ 2006-11-15  1:32         ` Brian McCullough
  2006-11-15  3:45           ` Brian McCullough
  2006-11-17 13:44         ` Brian McCullough
  1 sibling, 1 reply; 11+ messages in thread
From: Brian McCullough @ 2006-11-15  1:32 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, Nov 14, 2006 at 11:06:58PM +0000, Alasdair G Kergon wrote:
> On Tue, Nov 14, 2006 at 06:00:03PM -0500, Brian McCullough wrote:
> >   Internal error: PV segments corrupted in vg_system.
> 
> First update your lvm2 software to avoid that bug: you shouldn't
> see internal errors!

After installing the latest version available ( packaged ), I get:

[root@clachan ~]# lvm version
LVM version:     2.02.06 (2006-05-12)
Library version: 1.02.07 (2006-05-11)
Driver version:  4.6.0


Should these be new enough?


Thank you,
Brian

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

* Re: [linux-lvm] How to restore a PV ??
  2006-11-15  1:32         ` Brian McCullough
@ 2006-11-15  3:45           ` Brian McCullough
  0 siblings, 0 replies; 11+ messages in thread
From: Brian McCullough @ 2006-11-15  3:45 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, Nov 14, 2006 at 08:32:48PM -0500, Brian McCullough wrote:
> On Tue, Nov 14, 2006 at 11:06:58PM +0000, Alasdair G Kergon wrote:
> > On Tue, Nov 14, 2006 at 06:00:03PM -0500, Brian McCullough wrote:
> > >   Internal error: PV segments corrupted in vg_system.
> > 
> > First update your lvm2 software to avoid that bug: you shouldn't
> > see internal errors!

OK, I went to the source and compiled the latest version of both the
library and LVM2.

Versions:

[root@clachan ~]# lvm version
  LVM version:     2.02.06 (2006-05-12)
  Library version: 1.02.12 (2006-10-13)
  Driver version:  4.6.0


pvscan:

[root@clachan ~]# pvscan
  5 PV(s) found for VG vg_system: expected 6
  Logical volume (lvol4) contains an incomplete mapping table.
  PV segment VG free_count mismatch: 1381 != 2572
  PV segment VG extent_count mismatch: 1417 != 2608
  Internal error: PV segments corrupted in vg_system.



Do I need to rebuild my kernel, too?

B-)

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

* Re: [linux-lvm] How to restore a PV ??
  2006-11-14 23:06       ` Alasdair G Kergon
  2006-11-15  1:32         ` Brian McCullough
@ 2006-11-17 13:44         ` Brian McCullough
  2006-11-17 19:21           ` Alasdair G Kergon
  1 sibling, 1 reply; 11+ messages in thread
From: Brian McCullough @ 2006-11-17 13:44 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, Nov 14, 2006 at 11:06:58PM +0000, Alasdair G Kergon wrote:
> On Tue, Nov 14, 2006 at 06:00:03PM -0500, Brian McCullough wrote:
> >   Internal error: PV segments corrupted in vg_system.
> 
> First update your lvm2 software to avoid that bug: you shouldn't
> see internal errors!


OK, as mentioned in previous messages, I have updated to the most recent
versions found on the FTP site ( lvm2 and dm ), but I am still getting
the same internal error being reported.  Do I need to do something with
the kernel?  I am running 2.6.17 on an AMD X86_64.

Is there somewhere in the LVM code that I could look for where this
internal error is being generated, so that I could perhaps dump the data
structures?


Thank you,
Brian

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

* Re: [linux-lvm] How to restore a PV ??
  2006-11-17 13:44         ` Brian McCullough
@ 2006-11-17 19:21           ` Alasdair G Kergon
  2006-11-18 10:24             ` Brian McCullough
  0 siblings, 1 reply; 11+ messages in thread
From: Alasdair G Kergon @ 2006-11-17 19:21 UTC (permalink / raw)
  To: LVM general discussion and development

On Fri, Nov 17, 2006 at 08:44:35AM -0500, Brian McCullough wrote:
> OK, as mentioned in previous messages, I have updated to the most recent
> versions found on the FTP site ( lvm2 and dm )

If you see that with the latest (2.02.14) then we've still
got a bug to fix there.

If you lost a partition table, look for something like 'gpart'
to try to recreate it.  Then you'll need to recreate the PV
and get the VG/LV back in place - the procedure depends on
whether it's lvm1 or lvm2 metadata and how much info you still
have (or can remember) about the layout.

Alasdair
-- 
agk@redhat.com

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

* Re: [linux-lvm] How to restore a PV ??
  2006-11-17 19:21           ` Alasdair G Kergon
@ 2006-11-18 10:24             ` Brian McCullough
  0 siblings, 0 replies; 11+ messages in thread
From: Brian McCullough @ 2006-11-18 10:24 UTC (permalink / raw)
  To: LVM general discussion and development

On Fri, Nov 17, 2006 at 07:21:24PM +0000, Alasdair G Kergon wrote:
> On Fri, Nov 17, 2006 at 08:44:35AM -0500, Brian McCullough wrote:
> > OK, as mentioned in previous messages, I have updated to the most recent
> > versions found on the FTP site ( lvm2 and dm )
> 
> If you see that with the latest (2.02.14) then we've still
> got a bug to fix there.
> 
> If you lost a partition table, look for something like 'gpart'
> to try to recreate it.  Then you'll need to recreate the PV
> and get the VG/LV back in place - the procedure depends on
> whether it's lvm1 or lvm2 metadata and how much info you still
> have (or can remember) about the layout.


The partition table is fine.  There are 5 ext2/3 partitions, one swap
partition and 5 LVM ( 8e ) partitions.  The LVM partitions appear to be
LVM version 1.


Thanks,
Brian



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

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

end of thread, other threads:[~2006-11-18 10:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-13  1:27 [linux-lvm] How to restore a PV ?? Jerome
2006-10-16 15:43 ` Jonathan E Brassow
2006-10-16 15:57 ` Jerome
2006-10-16 19:20   ` Jonathan E Brassow
2006-11-14 23:00     ` Brian McCullough
2006-11-14 23:06       ` Alasdair G Kergon
2006-11-15  1:32         ` Brian McCullough
2006-11-15  3:45           ` Brian McCullough
2006-11-17 13:44         ` Brian McCullough
2006-11-17 19:21           ` Alasdair G Kergon
2006-11-18 10:24             ` Brian McCullough

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