* [linux-lvm] removed disk without using vgreduce
@ 2004-01-14 13:41 Trond Michelsen
0 siblings, 0 replies; 3+ messages in thread
From: Trond Michelsen @ 2004-01-14 13:41 UTC (permalink / raw)
To: linux-lvm
Hi.
I've just screwed up my volume group, and I hope there's a way to fix
it.
I recently had to change one of the disks in my system, so I added a new
disk, and used pvmove to move all PEs from the old disk to the new. Then
I mounted the LV to make sure that everything was fine. Then I shut down
the system, removed the disk and gave it away. Completely forgetting
about vgreduce. Obviously, now vgscan can't find all PVs belonging to
the VG, so it refuses to make it available. vgreduce can't remove a PV
from a VG that isn't available, so I'm a bit stuck now.
The original disk is now gone and reformatted, so sticking it back into
the system for a couple of minutes is not an option, unfortunately :(
Is there a way to let LVM know that this disk is no longer part of the
VG, without having it?
--
// Trond Michelsen
\X/ mike@crusaders.no
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [linux-lvm] removed disk without using vgreduce
@ 2004-01-14 14:10 Dan_Caulfield
2004-01-15 17:29 ` Trond Michelsen
0 siblings, 1 reply; 3+ messages in thread
From: Dan_Caulfield @ 2004-01-14 14:10 UTC (permalink / raw)
To: linux-lvm
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.
-----Original Message-----
From: linux-lvm-admin@sistina.com [mailto:linux-lvm-admin@sistina.com] On
Behalf Of Trond Michelsen
Sent: Wednesday, January 14, 2004 12:44 PM
To: linux-lvm@sistina.com
Subject: [linux-lvm] removed disk without using vgreduce
Hi.
I've just screwed up my volume group, and I hope there's a way to fix it.
I recently had to change one of the disks in my system, so I added a new
disk, and used pvmove to move all PEs from the old disk to the new. Then I
mounted the LV to make sure that everything was fine. Then I shut down the
system, removed the disk and gave it away. Completely forgetting about
vgreduce. Obviously, now vgscan can't find all PVs belonging to the VG, so
it refuses to make it available. vgreduce can't remove a PV from a VG that
isn't available, so I'm a bit stuck now.
The original disk is now gone and reformatted, so sticking it back into the
system for a couple of minutes is not an option, unfortunately :( Is there a
way to let LVM know that this disk is no longer part of the VG, without
having it?
--
// Trond Michelsen
\X/ mike@crusaders.no
_______________________________________________
linux-lvm mailing list
linux-lvm@sistina.com
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] removed disk without using vgreduce
2004-01-14 14:10 [linux-lvm] removed disk without using vgreduce Dan_Caulfield
@ 2004-01-15 17:29 ` Trond Michelsen
0 siblings, 0 replies; 3+ messages in thread
From: Trond Michelsen @ 2004-01-15 17:29 UTC (permalink / raw)
To: linux-lvm
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-01-15 17:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-14 14:10 [linux-lvm] removed disk without using vgreduce Dan_Caulfield
2004-01-15 17:29 ` Trond Michelsen
-- strict thread matches above, loose matches on Subject: below --
2004-01-14 13:41 Trond Michelsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox