1834804 Members
2325 Online
110070 Solutions
New Discussion

Re: Volume Group Change.

 
SOLVED
Go to solution
ben_43
Frequent Advisor

Volume Group Change.

Hi Team:

I need to sync up two machines in terms of volume group. This is what i have on Machine A
bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 204800 37025 157313 19% /
/dev/vg00/lvol1 199381 55677 123765 31% /stand
/dev/vg00/lvol7 4194304 673015 3304073 17% /var
/dev/vg00/lvcrash 4194304 16840 3916380 0% /var/adm/crash
/dev/vg00/lvol6 2097152 698067 1311670 35% /usr
/dev/vg00/lvol5 1048576 48713 937476 5% /tmp
/dev/vg00/lvol4 4194304 501416 3462127 13% /opt
/dev/vg02/lvhome 10485760 217572 9947338 2% /home
/dev/vg04/lvdepot 2097152 1614 1964574 0% /depot
/dev/vg05/lvnet 2097152 223247 1758338 11% /usr/net
/dev/vg05/lvdata 2097152 368559 1620748 19% /usr/data

Machine B
bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 204800 37929 156505 20% /
/dev/vg00/lvol1 199381 56383 123059 31% /stand
/dev/vg00/lvol7 4194304 659465 3314510 17% /var
/dev/vg00/lvcrash 4194304 2129 3930172 0% /var/adm/crash
/dev/vg00/lvol6 2097152 1381446 671108 67% /usr
/dev/vg00/lvol5 1048576 38769 946898 4% /tmp
/dev/vg00/lvol4 4194304 484146 3478357 12% /opt
/dev/vg02/lvhome 10485760 188574 9975956 2% /home
/dev/vg04/lvdepot 2097152 1616 1964571 0% /depot
/dev/vg01/lvnet 2097152 221769 1758260 11% /usr/net
/dev/vg01/lvdata 2097152 383033 1607098 19% /usr/data
I want Machine A to syncup with Machine B and i need vg05 to be renamed as vg01 on Machine A. Please advise me on the steps.

Thanks
Ben J
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor

Re: Volume Group Change.

Hi Ben:

On machine-A:

# umount /dev/vg05/lvnet
# umount /dev/vg05/lvdata
# vgchange -a n /dev/vg05
# vgexport -m /tmp/vg05map /dev/vg05
# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000
# vgimport -m /tmp/vg05map /dev/dsk/cXtYdZ ...
# vgchange -a y /dev/vg01
# mount -a

Regards!

...JRF...




S.K. Chan
Honored Contributor

Re: Volume Group Change.

On machine A ..

# cd /
# vgdisplay -v vg05
==> Take note of all the PV-paths (say for example they are c2t1d0 and c4t1d0)
# umount /usr/net
# umount /usr/data
==> Umount the directories.
# vgchange -a n /dev/vg05
==> De-activate the VG.
# vgexport -m mapfile /dev/vg05
==> Remove VG entry fr lvmtab and all its devices files.
# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000
==> Create the driver for vg01.
# vgimport -m mapfile /dev/vg01 /dev/dsk/c2t1d0 /dev/dsk/c4t1d0
# vgchange -a y /dev/vg01
# vgcfgbackup /dev/vg01
# vi /etc/fstab
==> Edit and change "vg05" to "vg01"
# mount -a
===> Mount the FS.
Patrick Wallek
Honored Contributor

Re: Volume Group Change.

I don't know how many disks comprise vg01 / vg05, so here's a slight improvement on JRF's method:


# vgexport -s -m /tmp/vg05map /dev/vg05

# vgimport -s -m /tmp/vg05map
Adding the '-s' option to vgexport / vgimport modifies your map file so that you don't have to specify the disks that are part of the VG. It adds a VGID number at the top of the mapfile when you do vgexport. When you do the vgimport it reads that VGID number and looks for all disks that belong to that VG.

It works very well. Use JRF's steps, but add the -s as in my examples above.
ben_43
Frequent Advisor

Re: Volume Group Change.

Thanks. That was quick. But i forgot to mention that in Both the machines /usr/net and /usr/data are controlled by MC/SG. For Machine A vg05 is controlled by Service Guard. Will that take any additional steps OR would the same steps apply? Env. 11.0

Thanks
Ben J
ben_43
Frequent Advisor

Re: Volume Group Change.

Hi:

Will JRF's and sk's method would still work considering vg05 is managed by Service Guard on Machine A??

Thanks
Ben J
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Volume Group Change.

The steps remain essentially the same.

At some point, you need to make the VG cluster-aware by issueing a vgchange -c y /dev/vgxx and in your package control scripts what is shown above an vgchange -a y should be changed to vgchange -a e. Man vgchange for details.

If it ain't broke, I can fix that.
Steve Post
Trusted Contributor

Re: Volume Group Change.

one little thing. If the machines are V-Class, you have to have the same number of alternate paths for physical volumes for both. The vgimport -s might not give it to you. It didn't for ME. One box has 2 paths to a physical disk. The 2nd box (via vgimport) has 4 paths to the physical disk. As a result, MC/Service Guard will FAIL.

Another little thing that's probably obvious. When running your "mknod" command have the hex number be the same on both the main node and alternate nodes.

steve
ben_43
Frequent Advisor

Re: Volume Group Change.

Thanks Clay and Steve!!! My Box is Nclass. Would it still apply?

Thanks
Ben J
Steve Post
Trusted Contributor

Re: Volume Group Change.

I don't know. I'm just starting if MC/Service Guard myself. I just wanted to warned you because I got burned on this on my last "maintenance day."