All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] create vg with same name as exported vg
@ 2003-10-01 18:15 Rich Turner
  2003-10-02 15:34 ` Rich Turner
  0 siblings, 1 reply; 5+ messages in thread
From: Rich Turner @ 2003-10-01 18:15 UTC (permalink / raw)
  To: linux-lvm

i have run into a situation where lvm2 does not behave the same as lvm1.
basically i want to be able to create a vg with the same name as an
exported vg.

in lvm1 (v1.0.3) is was able to export the vg and create a vg with the
same name on a different pv. the original "vgturner4" was on /dev/hda6.
# vgchange -a n vgturner4
# vgexport vgturner4
# pvcreate -ff /dev/hda7
# vgcreate vgturner4 /dev/hda7

in lvm2 (v2.00.07) it complained that there was already a vg with that
name. the original vg was on /dev/sdc.
# vgchange -a n vg1
# vgexport vg1
# pvcreate -ff /dev/sda
# vgcreate vg1 /dev/sda
  A volume group called 'vg1' already exists.

a "vgscan" in lvm1 returns:
# vgscan
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- found active volume group "vg0"
vgscan -- found active volume group "vgturner4"
vgscan -- found active volume group "vg0m"
vgscan -- found exported volume group "vgturner4PV_EXP"
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created
vgscan -- WARNING: This program does not do a VGDA backup of your volume
groups

a "vgscan" in lvm2 returns:
# vgscan
Reading all physical volumes.  This may take a while...
  Found exported volume group "vg1" using metadata type lvm2

i notice that the exported vg in lvm1 is actually renamed but in lvm2 it
retains its original name. any ideas on how to accomplish what i want to
do in lvm2?

rich turner

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

* Re: [linux-lvm] create vg with same name as exported vg
  2003-10-01 18:15 [linux-lvm] create vg with same name as exported vg Rich Turner
@ 2003-10-02 15:34 ` Rich Turner
  2003-10-10 14:03   ` Alasdair G Kergon
  0 siblings, 1 reply; 5+ messages in thread
From: Rich Turner @ 2003-10-02 15:34 UTC (permalink / raw)
  To: linux-lvm

is this a bug within lvm2, is it no longer possible with lvm2, or is
there a different procedure to accomplish this?

On Wed, 2003-10-01 at 16:13, Rich Turner wrote:
> i have run into a situation where lvm2 does not behave the same as lvm1.
> basically i want to be able to create a vg with the same name as an
> exported vg.
> 
> in lvm1 (v1.0.3) is was able to export the vg and create a vg with the
> same name on a different pv. the original "vgturner4" was on /dev/hda6.
> # vgchange -a n vgturner4
> # vgexport vgturner4
> # pvcreate -ff /dev/hda7
> # vgcreate vgturner4 /dev/hda7
> 
> in lvm2 (v2.00.07) it complained that there was already a vg with that
> name. the original vg was on /dev/sdc.
> # vgchange -a n vg1
> # vgexport vg1
> # pvcreate -ff /dev/sda
> # vgcreate vg1 /dev/sda
>   A volume group called 'vg1' already exists.
> 
> a "vgscan" in lvm1 returns:
> # vgscan
> vgscan -- reading all physical volumes (this may take a while...)
> vgscan -- found active volume group "vg0"
> vgscan -- found active volume group "vgturner4"
> vgscan -- found active volume group "vg0m"
> vgscan -- found exported volume group "vgturner4PV_EXP"
> vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created
> vgscan -- WARNING: This program does not do a VGDA backup of your volume
> groups
> 
> a "vgscan" in lvm2 returns:
> # vgscan
> Reading all physical volumes.  This may take a while...
>   Found exported volume group "vg1" using metadata type lvm2
> 
> i notice that the exported vg in lvm1 is actually renamed but in lvm2 it
> retains its original name. any ideas on how to accomplish what i want to
> do in lvm2?
> 
> rich turner
> 
> 
> _______________________________________________
> 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] 5+ messages in thread

* Re: [linux-lvm] create vg with same name as exported vg
  2003-10-02 15:34 ` Rich Turner
@ 2003-10-10 14:03   ` Alasdair G Kergon
  2003-10-10 14:22     ` Rich Turner
  0 siblings, 1 reply; 5+ messages in thread
From: Alasdair G Kergon @ 2003-10-10 14:03 UTC (permalink / raw)
  To: Rich Turner; +Cc: linux-lvm

> i have run into a situation where lvm2 does not behave the same as lvm1.
> basically i want to be able to create a vg with the same name as an
> exported vg.

> is this a bug within lvm2, is it no longer possible with lvm2, or is
> there a different procedure to accomplish this?

The LVM2 tools get confused if they see 2 VGs (1 live, 1 exported) with 
the same name.  It is not trivial to change to tools to cope with this,
so for now, you should avoid getting into this situation.  [If
necessary, use lvm.conf filters to hide the exported PVs while you
rename the live VG to something else.]

Alasdair
-- 
agk@uk.sistina.com

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

* Re: [linux-lvm] create vg with same name as exported vg
  2003-10-10 14:03   ` Alasdair G Kergon
@ 2003-10-10 14:22     ` Rich Turner
  2003-10-10 14:42       ` Alasdair G Kergon
  0 siblings, 1 reply; 5+ messages in thread
From: Rich Turner @ 2003-10-10 14:22 UTC (permalink / raw)
  To: Alasdair G Kergon; +Cc: linux-lvm

LVM1 actually handled this very well. With LVM1 it would rename the VG,
appending "PV_EXP" to the VG name when exporting it. This essentially
would allow creating a new VG with the same original name. I am kind of
surprised this did not carry over to LVM2.

I understand that the easiest solution would be to not be in this
situation. Unfortunately, my company develops disaster recovery software
that allows users to create/re-create/migrate LVM disk configuration. We
need to be very careful about how we detect and create PV's/VG's.

On Fri, 2003-10-10 at 12:01, Alasdair G Kergon wrote:
> > i have run into a situation where lvm2 does not behave the same as lvm1.
> > basically i want to be able to create a vg with the same name as an
> > exported vg.
> 
> > is this a bug within lvm2, is it no longer possible with lvm2, or is
> > there a different procedure to accomplish this?
> 
> The LVM2 tools get confused if they see 2 VGs (1 live, 1 exported) with 
> the same name.  It is not trivial to change to tools to cope with this,
> so for now, you should avoid getting into this situation.  [If
> necessary, use lvm.conf filters to hide the exported PVs while you
> rename the live VG to something else.]
> 
> Alasdair

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

* Re: [linux-lvm] create vg with same name as exported vg
  2003-10-10 14:22     ` Rich Turner
@ 2003-10-10 14:42       ` Alasdair G Kergon
  0 siblings, 0 replies; 5+ messages in thread
From: Alasdair G Kergon @ 2003-10-10 14:42 UTC (permalink / raw)
  To: Rich Turner; +Cc: linux-lvm

On Fri, Oct 10, 2003 at 12:20:44PM -0700, Rich Turner wrote:
> LVM1 actually handled this very well. With LVM1 it would rename the VG,
> appending "PV_EXP" to the VG name when exporting it.

LVM2 still does that for lvm1-format VGs of course.
And for lvm2-format VGs it simply sets a flag in the metadata
to say it's exported.

No, the issue is that LVM2 is using the not-guaranteed-to-be-unique 
VG name internally in places where it ought to be using the unique
VG uuid.

And vgimport should work by VG uuid (in case there are several
exported VGs present all with the same name) and require a new 
post-imported name to be specified if there's already a live VG
with the same name.

Alasdair
-- 
agk@uk.sistina.com

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

end of thread, other threads:[~2003-10-10 14:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-01 18:15 [linux-lvm] create vg with same name as exported vg Rich Turner
2003-10-02 15:34 ` Rich Turner
2003-10-10 14:03   ` Alasdair G Kergon
2003-10-10 14:22     ` Rich Turner
2003-10-10 14:42       ` Alasdair G Kergon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.