Operating System - HP-UX
1834015 Members
2629 Online
110063 Solutions
New Discussion

mounting VG on another system that already has same VG name

 
SOLVED
Go to solution
Charles Temple
Advisor

mounting VG on another system that already has same VG name

Hi,
How can I mount a volume group from one system to another system. The new system already has active volume group on it with same name. SOrt of like MCSG, but manually without software. i.e VG03 on server A needs to be mounted on VG03 on server B. Can I vgimport and change what VOLUME GROUP it will activate too? LIke to VG04?
Hope I explained myself correctly.
Thanks,
Charlie
14 REPLIES 14
RAC_1
Honored Contributor

Re: mounting VG on another system that already has same VG name

From server one, prepare a map and put it on another host. On node one deactivate it.
On second,
mkdir /dev/vgxx
mknod /dev/vgxx/group x 64 0x050000
(assuming vg05 monor number)
vgimport -v -m /mapfile /dev/vgxx
Activate and mount.

Anil
There is no substitute to HARDWORK
Steven E. Protter
Exalted Contributor

Re: mounting VG on another system that already has same VG name

To deactivate:

vgchange -a n /dev/vg00

# use real vgname


to activate

vgchange -a y /dev/vg00

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Charles Temple
Advisor

Re: mounting VG on another system that already has same VG name

sorry but I know how to do that, what I need help, and not even sure possible, but 2 systems with same VG NAME. vg01 say. I need to activate server's A VG01 onto server B's VG01. Or vgimport but change name of volume group. I know the VG name is already on the disks so not sure if we can just change names.

Charlie
RAC_1
Honored Contributor

Re: mounting VG on another system that already has same VG name

That is what both posts told you. On second system, you can use any name you want. Just make sure that you are using any exsisiting vg's minor number.
There is no substitute to HARDWORK
Charles Temple
Advisor

Re: mounting VG on another system that already has same VG name

How can I use vg01 if that is already being used? if you look at at the pvdisplay doesn't the disk want to be in the same volume group it just came from?
Devender Khatana
Honored Contributor

Re: mounting VG on another system that already has same VG name

Hi Charles,

Yes, you can import vg03 of serverA as vg04 on serverB.

Anil -
>Just make sure that you are using any exsisiting vg's minor number.

Correcttion - Just make sure you are not using any existing VG's minor number.

Deavtivate and Deportvg03 on serverA
After unmount file systems belonging to /dev/vg03 on serverA
#vgexport -v /dev/vg03


Procedure for importing remote VG :-
On Server B (Assuming disks are allready accessible on serverB and devices files for them is allready created)

#mkdir /dev/vg04
#cd /dev/vg04
#mknod group c 64 0x0?0000
?= Unique no. in this host ( Confirm by 'ls -l /dev/vg*/group' and use next available no. (0x000000,0x010000,0x020000...)
#vgimport /dev/vg04 /dev/dsk/cxtydz /dev/dsk/cx1ty1dz1 (Give address of all the disks of that vg as they are accessible on serverB)
#vgchange -a y /dev/vg01
You will find device files of all the logical volumes in /dev/vg03 of serverA, in /dev/vg04 of serverB and you can mount these on any desired mount points.


HTH,
Devender
Impossible itself mentions "I m possible"
Naveej.K.A
Honored Contributor

Re: mounting VG on another system that already has same VG name

Hi charles,

When you "vgexport" the Volume group is deleted and the information about the VG is removed from /etc/lvmtab and from the PV headers.

and the information is recreated in the new machine when you vgimport it.

Regards,
Naveej
practice makes a man perfect!!!
Charles Temple
Advisor

Re: mounting VG on another system that already has same VG name

Thanks for all the answers. But I know you can do that if you vgexport and delete on the server A side. I need to know if you do a vgexport -s -p -m vgxx.map and then try to import on other server to diffrent vg. Is that possible?

THanks,
Charlie
Devender Khatana
Honored Contributor

Re: mounting VG on another system that already has same VG name

Hi,

Yes it is quite possible. Atlast it is same vgexport command you are using, options do not matter.

HTH,
Devender
Impossible itself mentions "I m possible"
Charles Temple
Advisor

Re: mounting VG on another system that already has same VG name

But if you do the vgexport with the -p it will not remove the volume group name from the disk, so how can you import to diffrent volume group name if disk thinks it already belongs to volume group.
Jdamian
Respected Contributor

Re: mounting VG on another system that already has same VG name

"But if you do the vgexport with the -p it will not remove the volume group name from the disk"

Volume group name is not contained into the physical disk.
Charles Temple
Advisor

Re: mounting VG on another system that already has same VG name

you do a pvdisplay on that disk and it comes back with the volume group name.
Here is example of pvdisplay on one of my disks.(luns)

pvdisplay /dev/dsk/c12t0d4
--- Physical volumes ---
PV Name /dev/dsk/c12t0d4
VG Name /dev/vg01
PV Status available
Allocatable yes
VGDA 2
Cur LV 1
PE Size (Mbytes) 8
Total PE 9598
Free PE 0
Allocated PE 9598
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On
Devender Khatana
Honored Contributor

Re: mounting VG on another system that already has same VG name

Hi Charles,

Yes, it will display the vg name from the disk which contained it. But a VG can be accessed from two hosts , but only from one at a time. And even if you remove information from first host by not applying -p option then also it can be recreated back on the host when you want to access it from this host again.

But it is always required to remove information pertaining to that vg from your host where you do not want to use this. Otherwise on reboot this host will probe you warnings related to that vg.


HTH,
Devender
Impossible itself mentions "I m possible"
Geoff Wild
Honored Contributor
Solution

Re: mounting VG on another system that already has same VG name

The name of the vg doesn't matter - only the contents.


For example - you have a backup server.

You have 3 hosts - SAN attached.
All have say /dev/vg10

Create map files on each server:

vgexport -p -s -v -m /tmp/vg10.`hostname`.map /dev/vg10

rcp those to the backup server.

On backup server:

mkdir /dev/vg10svr1
mkdir /dev/vg10svr2
mkdir /dev/vg10svr3

mknod /dev/vg10svr1/group c 64 0x0a0000
mknod /dev/vg10svr2/group c 64 0x0b0000
mknod /dev/vg10svr3/group c 64 0x0c0000

vgimport -s -v -m /tmp/vg10.server1.map /dev/vg10svr1

vgimport -s -v -m /tmp/vg10.server2.map /dev/vg10svr2

vgimport -s -v -m /tmp/vg10.server3.map /dev/vg10svr3

Create your mount points....

Then, umount file systems on each server, then vgchange -a n the vg's on those servers...

On backup server,
vgchange -a y /dev/vg10svr1
vgchange -a y /dev/vg10svr2
vgchange -a y /dev/vg10svr3

Then mount the file systems and back them up...

When done - umount, vgchange -a n them, and vgchange -a y and mount on the actual servers...

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.