linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] how to change the volume group name of the attached backup
@ 2010-03-18 14:43 Sarkar, Kaushik
  2010-03-18 14:56 ` Mike Snitzer
  2010-03-18 15:15 ` Andreas Olsowski
  0 siblings, 2 replies; 6+ messages in thread
From: Sarkar, Kaushik @ 2010-03-18 14:43 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

Hi,

 

I have a 2 Linux(RHL) machines (L1 and L2).  One is clone of other. I
have taken the backup of a L1. Now I have attached that backup to L2.

 

Before attaching L2 has /dev/sda and after attatchement it has /dev/sdb

But I cant mount /dev/sdb as it is on LVM. As both are having same VG
NAME I can't even mount logical volume.

So I thought to change the volume group name of the second but not able
to do that.

 

My intention is to mount the backup of L1 in L2 to check all data are
correct.

 

Need your help to solve it.

 

Thanks in advance.

-kaushik

 


[-- Attachment #2: Type: text/html, Size: 3164 bytes --]

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

* Re: [linux-lvm] how to change the volume group name of the attached backup
  2010-03-18 14:43 [linux-lvm] how to change the volume group name of the attached backup Sarkar, Kaushik
@ 2010-03-18 14:56 ` Mike Snitzer
  2010-03-18 20:57   ` chris procter
  2010-03-18 15:15 ` Andreas Olsowski
  1 sibling, 1 reply; 6+ messages in thread
From: Mike Snitzer @ 2010-03-18 14:56 UTC (permalink / raw)
  To: LVM general discussion and development

On Thu, Mar 18 2010 at 10:43am -0400,
Sarkar, Kaushik <Kaushik.Sarkar@netapp.com> wrote:

> Hi,
> 
>  
> 
> I have a 2 Linux(RHL) machines (L1 and L2).  One is clone of other. I
> have taken the backup of a L1. Now I have attached that backup to L2.
> 
>  
> 
> Before attaching L2 has /dev/sda and after attatchement it has /dev/sdb
> 
> But I cant mount /dev/sdb as it is on LVM. As both are having same VG
> NAME I can't even mount logical volume.
> 
> So I thought to change the volume group name of the second but not able
> to do that.
> 
>  
> 
> My intention is to mount the backup of L1 in L2 to check all data are
> correct.
> 
>  
> 
> Need your help to solve it.

Please see: man vgimportclone

Though vgimportclone is only provided in newer versions of lvm2 (>=
2.02.46).

Mike

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

* Re: [linux-lvm] how to change the volume group name of the attached backup
  2010-03-18 14:43 [linux-lvm] how to change the volume group name of the attached backup Sarkar, Kaushik
  2010-03-18 14:56 ` Mike Snitzer
@ 2010-03-18 15:15 ` Andreas Olsowski
  2010-03-18 15:32   ` Mike Snitzer
  1 sibling, 1 reply; 6+ messages in thread
From: Andreas Olsowski @ 2010-03-18 15:15 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

> But I cant mount /dev/sdb as it is on LVM. As both are having same VG
> NAME I can't even mount logical volume.
try:
vgextend NAME /dev/sdb



-- 
Andreas Olsowski <andreas.olsowski@uni.leuphana.de>
Leuphana Universität Lüneburg
System- und Netzwerktechnik
Rechenzentrum, Geb 7, Raum 15
Scharnhorststr. 1
21335 Lüneburg

Tel: ++49 4131 / 6771309

[-- Attachment #2: Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [linux-lvm] how to change the volume group name of the attached backup
  2010-03-18 15:15 ` Andreas Olsowski
@ 2010-03-18 15:32   ` Mike Snitzer
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Snitzer @ 2010-03-18 15:32 UTC (permalink / raw)
  To: LVM general discussion and development

On Thu, Mar 18 2010 at 11:15am -0400,
Andreas Olsowski <andreas.olsowski@uni.leuphana.de> wrote:

> > But I cant mount /dev/sdb as it is on LVM. As both are having same VG
> > NAME I can't even mount logical volume.
> try:
> vgextend NAME /dev/sdb

No, please don't.  This advice is incorrect.  vgimportclone is the only
supported lvm tool to make a cloned LUN distinct.

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

* Re: [linux-lvm] how to change the volume group name of the attached backup
  2010-03-18 14:56 ` Mike Snitzer
@ 2010-03-18 20:57   ` chris procter
  0 siblings, 0 replies; 6+ messages in thread
From: chris procter @ 2010-03-18 20:57 UTC (permalink / raw)
  To: LVM general discussion and development

>> Hi,

>> 
>> I have a 2 Linux(RHL) machines (L1 and L2).  One is clone of other. I have 
>> taken the backup of a L1. Now I have attached that backup to L2.
>> 
>> Before attaching L2 has /dev/sda and after attatchement it has /dev/sdb
>> 
>> But I cant mount /dev/sdb as it is on LVM. As both are having same VG
>> NAME I can't even mount logical volume.
>> 
>> So I thought to change the volume group name of the 
>> second but not able to do that.
>>
>> My intention is to mount the backup of L1 in L2 to check all data are
>> 
>> correct.
>> 
>> Need your help to solve it.

>Please see: man vgimportclone
>
>Though vgimportclone is only provided in newer versions of lvm2 
> (>= 2.02.46).
>
>Mike

Just to expand on Mikes comments, you'll have two volume groups with the same name, but lvm thinks its just seeing the same vg twice because they both have the same uuid, and it will think sda and sdb are two paths to the same device because they have the same uuid as well.  

The good news is this is exactly the situation vgimportclone was written to solve so running something like (read the man page first, its good, Mike wrote it!)
#  vgimportclone -n MYNEWVG /dev/sdb 
should fix things for you.

The other bit of good news is that while vgimportclone only comes with versions of lvm >= 2.02.46 I think it  works on any RHEL 5.x  (it was written on rhel 5.0 iirc but I can't remember the lvm version)  so if you can get a copy from cvs or somewhere you should be ok.

If your using rhel 4 or earlier then you have a problem, but if you can present the clone to another machine (L3 :)  and run vgimportclone then present it back to L2 that should work.  Theres a bug somewhere in the rhel 4 version of lvm that means it doesn't respect changes to LVM_SYSTEM_DIR. 

chris


      

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

* [linux-lvm] how to change the volume group name of the attached backup
@ 2010-04-01 10:05 Sarkar, Kaushik
  0 siblings, 0 replies; 6+ messages in thread
From: Sarkar, Kaushik @ 2010-04-01 10:05 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 137 bytes --]

Thanks Mike and Chris 

Vgimport solve everything. It reduces 1250 lines of code to just 400
lines approx.

 

-thanks Kaushik


[-- Attachment #2: Type: text/html, Size: 4912 bytes --]

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

end of thread, other threads:[~2010-04-01 10:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-18 14:43 [linux-lvm] how to change the volume group name of the attached backup Sarkar, Kaushik
2010-03-18 14:56 ` Mike Snitzer
2010-03-18 20:57   ` chris procter
2010-03-18 15:15 ` Andreas Olsowski
2010-03-18 15:32   ` Mike Snitzer
  -- strict thread matches above, loose matches on Subject: below --
2010-04-01 10:05 Sarkar, Kaushik

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