Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id i2GN4Ij04420 for ; Tue, 16 Mar 2004 18:04:18 -0500 Received: from p15124399.pureserver.info (p15124399.pureserver.info [217.160.182.169]) by mx1.redhat.com (8.12.10/8.12.10) with SMTP id i2GN4H4b005216 for ; Tue, 16 Mar 2004 18:04:17 -0500 Received: from rockley.barbados (81-5-142-175.dsl.eclipse.net.uk [81.5.142.175]) (authenticated (0 bits)) by p15124399.pureserver.info (8.11.6/8.11.6) with ESMTP id i2GN4BV26818 for ; Tue, 16 Mar 2004 23:04:11 GMT Subject: Re: [linux-lvm] LVM Problems when moving data off a PV From: Nick Gushlow In-Reply-To: <20040315123445.GA17078@redhat.com> References: <1079271129.2414.7.camel@rockley.barbados> <20040315123445.GA17078@redhat.com> Content-Type: multipart/alternative; boundary="=-yjoQLci7ZNn1nc8sucMa" Message-Id: <1079478248.28877.6.camel@rockley.barbados> Mime-Version: 1.0 Date: Tue, 16 Mar 2004 23:04:09 +0000 Reply-To: nick@gushlow.com, LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: To: linux-lvm@redhat.com --=-yjoQLci7ZNn1nc8sucMa Content-Type: text/plain Content-Transfer-Encoding: 7bit On Mon, 2004-03-15 at 12:34, Heinz Mauelshagen wrote: > > You need to select the last valid metadata backup of vg2 from /etc/lvmconf > (check it with vgcfgrestore -ll -f /etc/lvmconf/vg2.conf[.#.old]; see > 'man vgcfgrestore for metadata archive file names) and restore it. > > Say vg.conf.1.old is the valid one: > > for dev in AllPVsOfVG2 # list all PVs reported by vgcfgrestore -ll above > do > pvcreate -ff $dev > vgcfgrestore -f /etc/lvmconf/vg.conf.1.old $dev > done > vgscan > vgchange -ay vg2 > That did the trick thanks. :-) Of course in a moment of not concentrating I messed things up again. I still had pvremove on the disk from when I previously installed the lvm2 tools, and although I wanted to do a vgreduce I did a pvremove. Even when it kicked up an error I just followed what it said and typed pvremove -ff. oops :-/ Now I get a a similar error as before with vgscan, and other tools give a 'VGDA in kernel and lvmtab are NTO consistent: please run vgscan' error. I tried re-running what you suggested above but vgcfgrestore gives a 'can't restore part of active volume group "vg2"' error. Is there anyway to recover from my stupidity (other than a lobotomy!)? --=-yjoQLci7ZNn1nc8sucMa Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit On Mon, 2004-03-15 at 12:34, Heinz Mauelshagen wrote:

You need to select the last valid metadata backup of vg2 from /etc/lvmconf
(check it with vgcfgrestore -ll -f /etc/lvmconf/vg2.conf[.#.old]; see
'man vgcfgrestore for metadata archive file names) and restore it.

Say vg.conf.1.old is the valid one:

for dev in AllPVsOfVG2 # list all PVs reported by vgcfgrestore -ll above
do
	pvcreate -ff $dev
	vgcfgrestore -f /etc/lvmconf/vg.conf.1.old $dev
done
vgscan
vgchange -ay vg2

That did the trick thanks. :-)

Of course in a moment of not concentrating I messed things up again.  I still had pvremove on the disk from when I previously installed the lvm2 tools, and although I wanted to do a vgreduce I did a pvremove.  Even when it kicked up an error I just followed what it said and typed pvremove -ff. oops :-/

Now I get a a similar error as before with vgscan, and other tools give a 'VGDA in kernel and lvmtab are NTO consistent: please run vgscan' error.

I tried re-running what you suggested above but vgcfgrestore gives a 'can't restore part of active volume group "vg2"' error.

Is there anyway to recover from my stupidity (other than a lobotomy!)?



--=-yjoQLci7ZNn1nc8sucMa--