From: Trond Michelsen <mike@crusaders.no>
To: linux-lvm@sistina.com
Subject: Re: [linux-lvm] removed disk without using vgreduce
Date: Thu Jan 15 17:29:01 2004 [thread overview]
Message-ID: <20040115233130.H847@crusaders.no> (raw)
In-Reply-To: <216066D1A4083A48BAD8651A0A2CF6A0E11E0F@ausx2kmpc104.aus.amer.dell.com>; from Dan_Caulfield@Dell.com on Wed, Jan 14, 2004 at 01:09:02PM -0600
On Wed, Jan 14, 2004 at 01:09:02PM -0600, Dan_Caulfield@Dell.com wrote:
> Even with the original disk being reformatted, you can use vgcfgrestore to
> restore the LVM metadata. I'm not sure of the exact syntax, so check the
> man page. You should be able to use vgscan followed by vgchange --partial
> -a -y to mount the volume group read-only. This might allow the vgreduce
> command to work.
Thank you. vgcfgrestore was all I needed.
So, in case anybody else are as stupid as me, here's what I did to
recover:
First I created a new PV on an unused partition I had.
# pvcreate /dev/hda5
pvcreate -- physical volume "/dev/hda5" successfully created
then I used vgcfgrestore with the --ignore_size argument, to have this
partition pretend to be the old disk
# vgcfgrestore --name vg1 --ignore_size --oldpath /dev/hdk --verbose /dev/hda5
vgcfgrestore -- INFO: using backup file "/etc/lvmconf/vg1.conf"
vgcfgrestore -- locking logical volume manager
vgcfgrestore -- restoring volume group "vg1" from "/etc/lvmconf/vg1.conf"
vgcfgrestore -- checking existence of "/etc/lvmconf/vg1.conf"
vgcfgrestore -- reading volume group data for "vg1" from "/etc/lvmconf/vg1.conf"
vgcfgrestore -- reading physical volume data for "vg1" from "/etc/lvmconf/vg1.conf"
vgcfgrestore -- reading logical volume data for "vg1" from "/etc/lvmconf/vg1.conf"
vgcfgrestore -- checking volume group consistency of "vg1"
vgcfgrestore -- checking volume group consistency of "vg1"
vgcfgrestore -- reading physical volume "/dev/hda5"
vgcfgrestore -- checking for new physical volume "/dev/hda5"
vgcfgrestore -- forcing write of VGDA of "vg1" to physical volume "/dev/hda5"
vgcfgrestore -- ignoring size mismatches
vgcfgrestore -- writing VGDA of "vg1" to physical volume "/dev/hda5"
vgcfgrestore -- removing any special files for "vg1"
vgcfgrestore -- VGDA for "vg1" successfully restored to physical volume "/dev/hda5"
after this, vgscan found the VG
# vgscan
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- found inactive volume group "vg1"
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created
vgscan -- WARNING: This program does not do a VGDA backup of your volume group
I activated the VG
# vgchange -a y vg1
vgchange -- volume group "vg1" successfully activated
and I could now remove the unused PV from the VG
# vgreduce vg1 /dev/hda5
vgreduce -- doing automatic backup of volume group "vg1"
vgreduce -- volume group "vg1" successfully reduced by physical volume:
vgreduce -- /dev/hda5
Finally, everything is back to normal :-)
Again. Thank you very much.
--
// Trond Michelsen
\X/ mike@crusaders.no
next prev parent reply other threads:[~2004-01-15 17:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-14 14:10 [linux-lvm] removed disk without using vgreduce Dan_Caulfield
2004-01-15 17:29 ` Trond Michelsen [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-01-14 13:41 Trond Michelsen
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=20040115233130.H847@crusaders.no \
--to=mike@crusaders.no \
--cc=linux-lvm@sistina.com \
/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