Linux LVM users
 help / color / mirror / Atom feed
* [linux-lvm] reading lun snapshots with identical lvm information on them on one machine
@ 2008-11-05  1:23 James A. Dinkel
  2008-11-05  1:31 ` Alasdair G Kergon
  2008-11-05  9:51 ` [linux-lvm] reading lun snapshots with identical lvm information on them " Bryn M. Reeves
  0 siblings, 2 replies; 11+ messages in thread
From: James A. Dinkel @ 2008-11-05  1:23 UTC (permalink / raw)
  To: linux-lvm

I have 4 san luns attached to a RedHat EL 5.2 server. Each partitioned with a single lvm partition, making up a single volume group. I've created a snapshot of these luns on the san and reattached the 4 snapshot luns back to the same server.

As you may guess, this does not work well since the partitions have identical volume group information on them. To begin with the drives just show up as 4 drives with lvm partitions on them. I had hoped that I could create a new volume group out of those 4 physical volumes and access the data, but I get this when I try (sdb,c,d,e are the original luns, sdf,g,h,i are the snapshot luns):

-------------------------
[brazen@server2 ~]$ sudo /usr/sbin/vgcreate vg-test-snap /dev/sdf1 /dev/sdg1 /dev/sdh1 /dev/sdi1
Password:
Found duplicate PV cJoNn4uwBjse586l3ZMxKMRo938bK1xp: using /dev/sdf1 not /dev/sdb1
Found duplicate PV eWQLAqej1AgEk0WDLPE0trVqlIreRbyU: using /dev/sdg1 not /dev/sdc1
Found duplicate PV qYx9aIoUEUjB78OAhBuXWmsjv3VCXjUr: using /dev/sdh1 not /dev/sdd1
Found duplicate PV DrgbFGRJ6ziMJqoj2HlTFk9LtQhZx0Fp: using /dev/sdi1 not /dev/sde1
Found duplicate PV cJoNn4uwBjse586l3ZMxKMRo938bK1xp: using /dev/sdb1 not /dev/sdf1
Found duplicate PV eWQLAqej1AgEk0WDLPE0trVqlIreRbyU: using /dev/sdc1 not /dev/sdg1
Found duplicate PV qYx9aIoUEUjB78OAhBuXWmsjv3VCXjUr: using /dev/sdd1 not /dev/sdh1
Found duplicate PV DrgbFGRJ6ziMJqoj2HlTFk9LtQhZx0Fp: using /dev/sde1 not /dev/sdi1
Found duplicate PV cJoNn4uwBjse586l3ZMxKMRo938bK1xp: using /dev/sdf1 not /dev/sdb1
Found duplicate PV eWQLAqej1AgEk0WDLPE0trVqlIreRbyU: using /dev/sdg1 not /dev/sdc1
Found duplicate PV qYx9aIoUEUjB78OAhBuXWmsjv3VCXjUr: using /dev/sdh1 not /dev/sdd1
Found duplicate PV DrgbFGRJ6ziMJqoj2HlTFk9LtQhZx0Fp: using /dev/sdi1 not /dev/sde1
Physical volume '/dev/sdf1' is already in volume group 'vg-test-data1'
Unable to add physical volume '/dev/sdf1' to volume group 'vg-test-snap'.
-----------------------

If anybody has any ideas for getting around this, I would love to hear it. Resorting to using lvm snapshots is going to be problematic.  I know it sounds convoluted, but I really need this to work with SAN snapshots.

Thanks,
�
James Dinkel
Computer Services, Butler County of Kansas

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

* Re: [linux-lvm] reading lun snapshots with identical lvm information on them on one machine
  2008-11-05  1:23 [linux-lvm] reading lun snapshots with identical lvm information on them on one machine James A. Dinkel
@ 2008-11-05  1:31 ` Alasdair G Kergon
  2008-11-05  1:41   ` [linux-lvm] reading lun snapshots with identical lvm informationon " James A. Dinkel
  2008-11-07 20:17   ` James A. Dinkel
  2008-11-05  9:51 ` [linux-lvm] reading lun snapshots with identical lvm information on them " Bryn M. Reeves
  1 sibling, 2 replies; 11+ messages in thread
From: Alasdair G Kergon @ 2008-11-05  1:31 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, Nov 04, 2008 at 07:23:39PM -0600, James A. Dinkel wrote:
> I have 4 san luns attached to a RedHat EL 5.2 server. Each partitioned with a
> single lvm partition, making up a single volume group. I've created a
> snapshot of these luns on the san and reattached the 4 snapshot luns back to
> the same server.
 
Making sure you know which are original and which are snapshot, run pvchange -u
on the snapshot ones, then vgchange -u and vgrename.

Use a filter in lvm.conf (env var LVM_SYSTEM_DIR to use different one if this is
an automated process, not a one-off) or with --config on each command so only
the snapshot devices are visible.

Alasdair
-- 
agk@redhat.com

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

* RE: [linux-lvm] reading lun snapshots with identical lvm informationon them on one machine
  2008-11-05  1:31 ` Alasdair G Kergon
@ 2008-11-05  1:41   ` James A. Dinkel
  2008-11-05  1:52     ` Alasdair G Kergon
  2008-11-07 20:17   ` James A. Dinkel
  1 sibling, 1 reply; 11+ messages in thread
From: James A. Dinkel @ 2008-11-05  1:41 UTC (permalink / raw)
  To: LVM general discussion and development

-----Original Message-----
From: Alasdair G Kergon
Sent: Tuesday, November 04, 2008 7:31 PM

Making sure you know which are original and which are snapshot, run
pvchange -u on the snapshot ones, then vgchange -u and vgrename.
<snip>

Alasdair
--------------------------

What does the '-u' do on pvchange and vgchange?  I couldn't find it in
the man pages.  Other than that question, I think I understand.  This
will be part of a script, so I will probably have the script create a
temporary config file and then use the --config option with each
command.
 

James Dinkel
Computer Services, Butler County of Kansas

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

* Re: [linux-lvm] reading lun snapshots with identical lvm informationon them on one machine
  2008-11-05  1:41   ` [linux-lvm] reading lun snapshots with identical lvm informationon " James A. Dinkel
@ 2008-11-05  1:52     ` Alasdair G Kergon
  0 siblings, 0 replies; 11+ messages in thread
From: Alasdair G Kergon @ 2008-11-05  1:52 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, Nov 04, 2008 at 07:41:12PM -0600, James A. Dinkel wrote:
> I couldn't find it in
> the man pages.  

Then read them on the web.
e.g. http://sources.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/LVM2/man/pvchange.8.in?rev=1.1&content-type=text/plain&cvsroot=lvm2

Alasdair
-- 
agk@redhat.com

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

* Re: [linux-lvm] reading lun snapshots with identical lvm information on them on one machine
  2008-11-05  1:23 [linux-lvm] reading lun snapshots with identical lvm information on them on one machine James A. Dinkel
  2008-11-05  1:31 ` Alasdair G Kergon
@ 2008-11-05  9:51 ` Bryn M. Reeves
  1 sibling, 0 replies; 11+ messages in thread
From: Bryn M. Reeves @ 2008-11-05  9:51 UTC (permalink / raw)
  To: LVM general discussion and development

James A. Dinkel wrote:
> I have 4 san luns attached to a RedHat EL 5.2 server. Each partitioned with a single lvm partition, making up a single volume group. I've created a snapshot of these luns on the san and reattached the 4 snapshot luns back to the same server.
> 
> As you may guess, this does not work well since the partitions have identical volume group information on them. To begin with the drives just show up as 4 drives with lvm partitions on them. I had hoped that I could create a new volume group out of those 4 physical volumes and access the data, but I get this when I try (sdb,c,d,e are the original luns, sdf,g,h,i are the snapshot luns):
> 
> -------------------------
> [brazen@server2 ~]$ sudo /usr/sbin/vgcreate vg-test-snap /dev/sdf1 /dev/sdg1 /dev/sdh1 /dev/sdi1

If you're going to create a new VG on them then why bother snapshotting 
at all? This will initialise a new volume group with no logical volumes 
(i.e. it erases all the metadata in the snapshots and renders the 
snapshotted data inaccessible). Are you sure that's what you wanted?

> Found duplicate PV cJoNn4uwBjse586l3ZMxKMRo938bK1xp: using /dev/sdf1 not /dev/sdb1
> Found duplicate PV eWQLAqej1AgEk0WDLPE0trVqlIreRbyU: using /dev/sdg1 not /dev/sdc1
> Found duplicate PV qYx9aIoUEUjB78OAhBuXWmsjv3VCXjUr: using /dev/sdh1 not /dev/sdd1
> Found duplicate PV DrgbFGRJ6ziMJqoj2HlTFk9LtQhZx0Fp: using /dev/sdi1 not /dev/sde1
> Found duplicate PV cJoNn4uwBjse586l3ZMxKMRo938bK1xp: using /dev/sdb1 not /dev/sdf1
> Found duplicate PV eWQLAqej1AgEk0WDLPE0trVqlIreRbyU: using /dev/sdc1 not /dev/sdg1
> Found duplicate PV qYx9aIoUEUjB78OAhBuXWmsjv3VCXjUr: using /dev/sdd1 not /dev/sdh1
> Found duplicate PV DrgbFGRJ6ziMJqoj2HlTFk9LtQhZx0Fp: using /dev/sde1 not /dev/sdi1
> Found duplicate PV cJoNn4uwBjse586l3ZMxKMRo938bK1xp: using /dev/sdf1 not /dev/sdb1
> Found duplicate PV eWQLAqej1AgEk0WDLPE0trVqlIreRbyU: using /dev/sdg1 not /dev/sdc1
> Found duplicate PV qYx9aIoUEUjB78OAhBuXWmsjv3VCXjUr: using /dev/sdh1 not /dev/sdd1
> Found duplicate PV DrgbFGRJ6ziMJqoj2HlTFk9LtQhZx0Fp: using /dev/sdi1 not /dev/sde1
> Physical volume '/dev/sdf1' is already in volume group 'vg-test-data1'
> Unable to add physical volume '/dev/sdf1' to volume group 'vg-test-snap'.
> -----------------------
> 
> If anybody has any ideas for getting around this, I would love to hear it. Resorting to using lvm snapshots is going to be problematic.  I know it sounds convoluted, but I really need this to work with SAN snapshots.

Use LVM's filtering options to exclude one or the other set of PVs. You 
can then either access one VG at a time (possibly using the 
LVM_SYSTEM_DIR environment variable to switch between the two filtering 
configurations), or you can re-name and re-ID one of the VGs to allow 
them to co-exist on the system. Since you appear to have wanted the 
snapshot VG to be named "vg-test-snap", this may be your best option.

See the steps I posted here for cloning an existing volume group:

https://www.redhat.com/archives/linux-lvm/2007-November/msg00039.html

There are also some notes in the LVM2 wiki on dealing with hardware 
snapshots:

http://sources.redhat.com/lvm2/wiki/HardwareSnapshotRestore

Regards,
Bryn.

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

* RE: [linux-lvm] reading lun snapshots with identical lvm informationon them on one machine
  2008-11-05  1:31 ` Alasdair G Kergon
  2008-11-05  1:41   ` [linux-lvm] reading lun snapshots with identical lvm informationon " James A. Dinkel
@ 2008-11-07 20:17   ` James A. Dinkel
  2008-11-08  1:19     ` Alasdair G Kergon
  2008-11-10 16:07     ` [linux-lvm] reading lun snapshots with identical lvminformationon " James A. Dinkel
  1 sibling, 2 replies; 11+ messages in thread
From: James A. Dinkel @ 2008-11-07 20:17 UTC (permalink / raw)
  To: LVM general discussion and development

-----Original Message-----
From: Alasdair G Kergon
Sent: Tuesday, November 04, 2008 7:31 PM
 
Making sure you know which are original and which are snapshot, run
pvchange -u
on the snapshot ones, then vgchange -u and vgrename.

Use a filter in lvm.conf (env var LVM_SYSTEM_DIR to use different one if
this is
an automated process, not a one-off) or with --config on each command so
only
the snapshot devices are visible.

Alasdair
_______________________________________________


I made a copy of /etc/lvm/lvm.conf to /tmp-lvm.conf, changed the filter
line to this:

Filter = [ "a|/dev/sdf|", "a|/dev/sdg|", "a|/dev/sdh|", "a|/dev/sdi|",
"r|.*|"  ]

(sdf, sdg, sdh, and sdi are all snapshot devices of the vg)

And then I ran "sudo /usr/sbin/pvchange --config /tmp-lvm.conf -u
/dev/sdf1" but I get this error:

  Parse error at byte 14 (line 1): unexpected token
  Failed to set overridden configuration entries.
  Run `pvchange --help' for more information.

Am I maybe using the --config option wrong?

James

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

* Re: [linux-lvm] reading lun snapshots with identical lvm informationon them on one machine
  2008-11-07 20:17   ` James A. Dinkel
@ 2008-11-08  1:19     ` Alasdair G Kergon
  2008-11-08  1:43       ` Alasdair G Kergon
  2008-11-10 16:07     ` [linux-lvm] reading lun snapshots with identical lvminformationon " James A. Dinkel
  1 sibling, 1 reply; 11+ messages in thread
From: Alasdair G Kergon @ 2008-11-08  1:19 UTC (permalink / raw)
  To: James A. Dinkel; +Cc: LVM general discussion and development

--config takes settings inline that override settings in the file
e.g. --config 'devices { filter = ... }'

The environment variable method replaces the whole /etc dir with
an alterative - e.g. set it to /etc/lvm-tmp and put the new conf file there.

Alasdair
-- 
agk@redhat.com

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

* Re: [linux-lvm] reading lun snapshots with identical lvm informationon them on one machine
  2008-11-08  1:19     ` Alasdair G Kergon
@ 2008-11-08  1:43       ` Alasdair G Kergon
  0 siblings, 0 replies; 11+ messages in thread
From: Alasdair G Kergon @ 2008-11-08  1:43 UTC (permalink / raw)
  To: James A. Dinkel; +Cc: LVM general discussion and development

On Sat, Nov 08, 2008 at 01:19:04AM +0000, Alasdair G Kergon wrote:
> The environment variable method replaces the whole /etc dir with
                                                     ^^^^
/etc/lvm

Alasdair
-- 
agk@redhat.com

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

* RE: [linux-lvm] reading lun snapshots with identical lvminformationon them on one machine
  2008-11-07 20:17   ` James A. Dinkel
  2008-11-08  1:19     ` Alasdair G Kergon
@ 2008-11-10 16:07     ` James A. Dinkel
  2008-11-10 16:34       ` [linux-lvm] reading lun snapshots with identical lvminformationonthem " James A. Dinkel
  1 sibling, 1 reply; 11+ messages in thread
From: James A. Dinkel @ 2008-11-10 16:07 UTC (permalink / raw)
  To: LVM general discussion and development

I'm getting closer, but still having an issue.  When I run this command:

sudo /usr/sbin/pvchange --config 'devices { filter = [ "a|/dev/sdf|",
"a|/dev/sdg|", "a|/dev/sdh|", "a|/dev/sdi|", "r|.*|"  ] }' -u /dev/sdf1

I get this error:

  Volume group containing /dev/sdf1 has active logical volumes
  0 physical volumes changed / 1 physical volume not changed
 
Sdf1-sdi1 are on SAN snapshots.  Is there something I have to do to
force the new uuid or to make pvchange see that these are not actually
active?
 

James Dinkel

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

* RE: [linux-lvm] reading lun snapshots with identical lvminformationonthem on one machine
  2008-11-10 16:07     ` [linux-lvm] reading lun snapshots with identical lvminformationon " James A. Dinkel
@ 2008-11-10 16:34       ` James A. Dinkel
  2008-11-10 17:02         ` Alasdair G Kergon
  0 siblings, 1 reply; 11+ messages in thread
From: James A. Dinkel @ 2008-11-10 16:34 UTC (permalink / raw)
  To: LVM general discussion and development

I think the key is this option: --config 'global{activation=0}' which I
left out.  How can I combine that with my filter rule in the --config
option?
 

James Dinkel


-----Original Message-----
From: linux-lvm-bounces@redhat.com [mailto:linux-lvm-bounces@redhat.com]
On Behalf Of James A. Dinkel
Sent: Monday, November 10, 2008 10:08 AM
To: LVM general discussion and development
Subject: RE: [linux-lvm] reading lun snapshots with identical
lvminformationonthem on one machine

I'm getting closer, but still having an issue.  When I run this command:

sudo /usr/sbin/pvchange --config 'devices { filter = [ "a|/dev/sdf|",
"a|/dev/sdg|", "a|/dev/sdh|", "a|/dev/sdi|", "r|.*|"  ] }' -u /dev/sdf1

I get this error:

  Volume group containing /dev/sdf1 has active logical volumes
  0 physical volumes changed / 1 physical volume not changed
 
Sdf1-sdi1 are on SAN snapshots.  Is there something I have to do to
force the new uuid or to make pvchange see that these are not actually
active?
 

James Dinkel


_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

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

* Re: [linux-lvm] reading lun snapshots with identical lvminformationonthem on one machine
  2008-11-10 16:34       ` [linux-lvm] reading lun snapshots with identical lvminformationonthem " James A. Dinkel
@ 2008-11-10 17:02         ` Alasdair G Kergon
  0 siblings, 0 replies; 11+ messages in thread
From: Alasdair G Kergon @ 2008-11-10 17:02 UTC (permalink / raw)
  To: LVM general discussion and development

On Mon, Nov 10, 2008 at 10:34:50AM -0600, James A. Dinkel wrote:
> I think the key is this option: --config 'global{activation=0}' which I
> left out.  How can I combine that with my filter rule in the --config
> option?
  
Yes - just list them one after the other within the quotes
--config 'global { ... } devices { ... }'
 
Alasdair
-- 
agk@redhat.com

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

end of thread, other threads:[~2008-11-10 17:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-05  1:23 [linux-lvm] reading lun snapshots with identical lvm information on them on one machine James A. Dinkel
2008-11-05  1:31 ` Alasdair G Kergon
2008-11-05  1:41   ` [linux-lvm] reading lun snapshots with identical lvm informationon " James A. Dinkel
2008-11-05  1:52     ` Alasdair G Kergon
2008-11-07 20:17   ` James A. Dinkel
2008-11-08  1:19     ` Alasdair G Kergon
2008-11-08  1:43       ` Alasdair G Kergon
2008-11-10 16:07     ` [linux-lvm] reading lun snapshots with identical lvminformationon " James A. Dinkel
2008-11-10 16:34       ` [linux-lvm] reading lun snapshots with identical lvminformationonthem " James A. Dinkel
2008-11-10 17:02         ` Alasdair G Kergon
2008-11-05  9:51 ` [linux-lvm] reading lun snapshots with identical lvm information on them " Bryn M. Reeves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox