Discussion:
Import duplicate volume group?
(too old to reply)
Sean
2006-04-19 15:57:12 UTC
Permalink
I have an unusual problem (I think) that I am hoping someone with more AIX
knowledge than me can help me with. I have a volume group mirroring from a
local hdisk to a SAN disk via mirrorvg. On the SAN I am able to make a
copy of that disk to another one.

I would like to mount up this copied
volume to the server and be able to access it for retreiving files or
taking backups. I can present the volume to the server and the server
picks it up as a new hdisk. The problem then is that it has all the
identification of the original disk so something like "lspv -l hdisk3"
shows that its name is hdisk2 and it is part of the other volume group.

If I try to import it via "importvg -y backupvg hdisk3" (not sure if that
would be the correct command) I get an error that states it is already
part of the other volume group.

I think I need to be able to change the hdisk name and the volume group
information on the disk to be able to import it. The problem is I don't
know any way of doing that without blowing away the logical volumes on the
disk.

Is this even possible? Are there other commands I need to be able to get
this volume accessible under a different volume group? Any help would be
appreciated.

Sean
Hajo Ehlers
2006-04-19 16:39:43 UTC
Permalink
Your problem is related to the fact that your SAN-Copy works more or
less like a dd thus the created copy will have the same PVID as the
original disk

That means:
1)
Use a different approach like: splitlvcopy


2)
To your current problem:
- Change the PVID on the VGDA on the new disk
Read the PVID directly from the disk
$ lquerypv -h /dev/hdisk#

Reset the PVID for the given hdisk
$ chdev -l hdisk# -a pv=clear

Assign a new PVID for the given hdisk
$chdev -l hdisk# -a pv=yes

Verify the change of the PVID for the given hdisk
$ lquerypv -h /dev/hdisk#

In case some problems arise run:
$ synclvodm

All untestet
hth
Hajo


- or Read a post from Matthew Landt abou this topic

From: Matthew Landt
Date: Sat, Dec 23 2000 12:20 am
I ran DD to replicate two PVs.
After reconfiguring with CFGMGR, I see duplicated PVID on both source and targetPVs.
Now, my source is currently mounted to the system. So, when
I VARYOFFVG and EXPORTVG and IMPORTVG it, I see both soure and
target having the same VG and PVID.
Therefore, I can't mount both PVs (or its LVs) to the filesystem simultaneously.
Now, what do I have to do (like changin ODM/VGDA), so that I can mount both soure and target with
diffent VG and PVID number to the same system.
Here was my last response to this question. I have done this kind of
thing (although not supported by IBM). Once the PVID is changed, you
will have to reimport the copy VG with a different name. There will
be duplicate LV names so the LV names on the copy VG will be changed
as it is being imported. You can use chlv to change them to something
more descriptive if you want. You will then need to update the
/etc/filesystems to point a NEW directory to the NEWLY named LVs so
BOTH filesystems can be mounted at the same time (with different
directories).

----------------------- OLD POST ------------------------------------
You could write a new PVID to the hdisk and write a new PVID to the
VGDA on the second drive. Then you should be able to import the VG
under
a different name. I was able to do this by dd'ing about 4MB off of the

PV in question. Then using a binary editor like bvi to find and
replace
the PVID's within that image. I then re-dd'd the changed image back
onto
the disk, rmdev -dl hdiskX to clear the old PVID information out of
odm,
cfgmgr, and import the copied VG on it's disk with the hand created
PVID.

I have no idea if this will mess anything else up, or any other
dangers/issues
in doing this, but I was able to move a testvg/disk to a new PVID by
using this method.
Sean
2006-04-19 16:53:45 UTC
Permalink
Post by Hajo Ehlers
Your problem is related to the fact that your SAN-Copy works more or
less like a dd thus the created copy will have the same PVID as the
original disk
1)
Use a different approach like: splitlvcopy
2)
- Change the PVID on the VGDA on the new disk
Read the PVID directly from the disk
$ lquerypv -h /dev/hdisk#
Reset the PVID for the given hdisk
$ chdev -l hdisk# -a pv=clear
Assign a new PVID for the given hdisk
$chdev -l hdisk# -a pv=yes
Verify the change of the PVID for the given hdisk
$ lquerypv -h /dev/hdisk#
$ synclvodm
Thanks! it looks like splitlvcopy might be the way to go. I will need to
look in to it. It looks like this should get me going for now.
Nicholas Buckley
2006-04-19 18:09:56 UTC
Permalink
Hi Sean,

Hajo's advice is sound.

May I suggest that you also investigate the 'recreatevg' command - developed
( it would seem ) to address the specific issue of PVIDs duplicated by disk
mirroring.

Cheers,

Nick,
Cardiff,
UK
Post by Sean
Post by Hajo Ehlers
Your problem is related to the fact that your SAN-Copy works more or
less like a dd thus the created copy will have the same PVID as the
original disk
1)
Use a different approach like: splitlvcopy
2)
- Change the PVID on the VGDA on the new disk
Read the PVID directly from the disk
$ lquerypv -h /dev/hdisk#
Reset the PVID for the given hdisk
$ chdev -l hdisk# -a pv=clear
Assign a new PVID for the given hdisk
$chdev -l hdisk# -a pv=yes
Verify the change of the PVID for the given hdisk
$ lquerypv -h /dev/hdisk#
$ synclvodm
Thanks! it looks like splitlvcopy might be the way to go. I will need to
look in to it. It looks like this should get me going for now.
Loading...