LVM and VxVM

Moving LUN (on SAN) between hpux vpar's

 
SOLVED
Go to solution
Bob Brown_1
Frequent Advisor

Moving LUN (on SAN) between hpux vpar's

I have several HPUX vpar's running on an RP8400.
They all are connected to an EMC CX500 SAN.

I want to be able to move LUN's (hence volume groups and filesystems) from one system to another.

Our staff knows how to move the LUN within the SAN but I need to know how to do the hpux side without losing any of the data.

I have generally heard of doing vgexport on one side, moving the LUN and then doing vgscan and vgimport on the other side. This seems to make sense, but in my years of hpux work I've never had to do any vgexport/vgimport work.

Can anyone point me to a step-by-step for doing this kind of change?

All of my volume groups are tied to a single filesystem. Some volume groups have only 1 LUN, some have multiple, but it all goes into one filesystem, so if we want to move a filesystem (which we do), it is all contained in one VG.

thanks!

-Bob
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: Moving LUN (on SAN) between hpux vpar's

Bob,

Here you go:

vgchange -a n /dev/vg01
vgexport -s -m /tmp/vg01/map /dev/vg01

copy the map to the new system

mkdir /dev/vg01
mknod /dev/vg01/group c64 0x010000
vgimport -s -m /tmp/vg01/map /dev/vg01
vgchange -a y /dev/vg01

Note that you can omit the maps if you use standard LV naming conventions. See man vgexport, man vgimport for details.


Pete

Pete
John Payne_2
Honored Contributor

Re: Moving LUN (on SAN) between hpux vpar's

Bob,

vgscan would work if the new VG is a unique name. (ie you have a vg02 on the new location, the one you are moving is not also called vg02.)

Assuming that's the case,
umount /your/filesystem
vgchange -a n vgxx
vgexport vgxx
then have SAN guys move the lun.
on target, make sure lun is presented
mkdir /dev/vgxx
mknod /dev/vgxx/group c 64 0xnn0000 (nn is unique for /dev/*/group files)
vgscan
vgchange -a y vgxx
mount /your/filesystem /dev/vgxx/lvol1
edit /etc/fstab
vgcfgbackup /dev/vgxx

Now, if you have a duplicate VG name, you have some more work to do.

umount /your/filesystem
vgchange -a n vgxx
vgexport vgxx
then have SAN guys move the lun.
on target, make sure lun is presented
mkdir /dev/vgxy
mknod /dev/vgxy/group c 64 0xnn0000 (nn is unique for /dev/*/group files)
vgchgid /dev/rdsk/cxtxdx
vgimport /dev/vgxy /dev/dsk/cxtxdx
vgchange -a y vgxx
mount /your/filesystem /dev/vgxx/lvol1
edit /etc/fstab
vgcfgbackup /dev/vgxx


Hope it helps

John
Spoon!!!!
Bob Brown_1
Frequent Advisor

Re: Moving LUN (on SAN) between hpux vpar's

What if the volume group name doesn't match?

(say it is vg12 on the original system and I want to bring it in as vg19 on the new one)?

-Bob
Geoff Wild
Honored Contributor
Solution

Re: Moving LUN (on SAN) between hpux vpar's

Easy - vgscan not needed.

On current system - make a map file:

vgexport -s -p -m vgXX1.map /dev/vgXX

Then get rid of it:

vgexport /dev/vgXX

Unmask the LUN's from that vpar, rmsf the hardware devs.

ftp the map file to the other system

mask the LUN's to it
ioscan -fnC disk
insf -e

mkdir /dev/vgXX
mknod /dev/vgXX/group c 64 0xHH0000
vgimport -s -v -m /tmp/vgXX.map /dev/vgXX

edit the fstab files on both systems and make/remove the directories for mounts.


Note XX is number in dec and HH in hex.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Geoff Wild
Honored Contributor

Re: Moving LUN (on SAN) between hpux vpar's

Yes - you can make it vg19 on new system.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
John Payne_2
Honored Contributor

Re: Moving LUN (on SAN) between hpux vpar's

Importing as a different volume name is not a problem, just do not do the vgscan. Instead do the vgimport. (I prefer this method anyway.) In the second set of instructions, just plug in vg19 instead of vg12.

John
Spoon!!!!
Pete Randall
Outstanding Contributor

Re: Moving LUN (on SAN) between hpux vpar's

Bob,

It doesn't matter what the name of the VG is. It can be vg01 on the original system and you can import it as vgbob on the new one.


Pete

Pete
Indrajit_1
Valued Contributor

Re: Moving LUN (on SAN) between hpux vpar's

Hi BOb;

Do the following steps..

Master Server..

#vgexport -p -v -s -m file.map /dev/vg_name

(please don't forget to use -p option)

Now ftp or scp file.map to Slave server.

Slave Server.
#cd /dev/vg_name (if the vg_name is already present)
#ls -l group

Note down the minor value (e.g 0x340000)

#vgexport -v -s /dev/vg_name
#mkdir /dev/vg_name
#mknode /dev/vg_name/group c 64 0x340000
#vgimport -v -s -m file.map /dev/vg_name
#vgdisplay -v vg_name

if it give any error massage.

#vgchange -a r vg_name
#vgdisplay -v vg_name
Revert it back to original position
#vgchange -a n vg_name

Hope this will help u to resolve ur issue

Cheers
indrajit


Never Ever Give Up