Linux LVM users
 help / color / mirror / Atom feed
From: "Bryn M. Reeves" <bmr@redhat.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] reading lun snapshots with identical lvm information on	them on one machine
Date: Wed, 05 Nov 2008 09:51:22 +0000	[thread overview]
Message-ID: <49116C9A.6040203@redhat.com> (raw)
In-Reply-To: <8D07631D47C3CB4F867AD7BCF07D5C232C87@excs01.bucoks>

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.

      parent reply	other threads:[~2008-11-05  9:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Bryn M. Reeves [this message]

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=49116C9A.6040203@redhat.com \
    --to=bmr@redhat.com \
    --cc=linux-lvm@redhat.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