how to move whole volume group from server A to server B (615 Views)
Reply
Super Advisor
NDO
Posts: 533
Registered: ‎12-10-2003
Message 1 of 10 (615 Views)
Accepted Solution

how to move whole volume group from server A to server B

Hi All!

 

I have been asked to move a whole VG (1.5Tb) from one server running 11.23 to another server running 11.31. The data is on a NetApp. The NetApp admin, has said that theis volume consists of two LUNs, and  from his side is a simple unmap, them map to another server. So how can I get those LUNS get mounted on the other server?

Please use plain text.
Honored Contributor
Patrick Wallek
Posts: 13,736
Registered: ‎06-21-2000
Message 2 of 10 (606 Views)

Re: how to move whole volume group from server A to server B

On your 11.23 system, do the following:

 

(This assumes a VG name of VG01 -- use your apropriate VG name)

 

Unmount all file systems that are part of VG01

 

Export the VG.  If you will not need it on your 11.23 system any more, do the following:

 

# vgexport -v -s -m /tmp/vg01.map /dev/vg01

 

Copy the /tmp/vg01.map file to your 11.31 server

 

 

On the 11.31 system:

 

(This assume using VG01 as the name and 0x010000 as the group file minor number.  Use appropriate values for your system)

 

Make sure the LUNs from the Netapp are  mapped to this server.  Use 'ioscan' to make sure the disks are visible.

 

# mkdir /dev/vg01

# mknod /dev/vg01/group c 64 0x010000

# vgimport -v -s -m /tmp/vg01.map /dev/vg01

# vgchange -a y /dev/vg01

 

Make sure you can see all the appopriate LVs in the VG

# vgdisplay -v /dev/vg01

 

Now you should be able to mount your LVs as needed.

Please use plain text.
Honored Contributor
Matti_Kurkela
Posts: 6,271
Registered: ‎12-02-2001
Message 3 of 10 (602 Views)

Re: how to move whole volume group from server A to server B

First, create a map file for the VG in the 11.23 server:

vgexport -v -s -p -m <vg_name>.map <vg_name>

 With the -p option, the vgexport command does not actually export the VG, just creates the map file. So you can run the command while the VG is still active.

 

Then copy the <vg_name>.map file to the 11.31 server.

 

Unmount the filesystems in this VG, and/or shutdown any databases using raw LVOLs that belong to this VG.

Deactivate the VG:

vgchange -a n <vg_name>

 

Then tell the NetApp admin to map the LUNs to the 11.31 server.

 

Use ioscan -fnNCdisk on the 11.31 server to confirm that the LUNs are visible.

Run "insf" if the disk devices are not created automatically (11.31 might create them automatically if all the storage-side settings are correct for 11.31).

 

The next three steps are optional on 11.31 if the system is up to date and you don't care about the device numbers (i.e. the 11.31 system is not part of a Serviceguard cluster with shared disks):

 

- create the /dev/<vg_name> directory for the VG you're importing

 

- list the existing minor device numbers with "ll /dev/*/group". The minor device number for each existing VG should be of the form 0xHH0000, where HH is two hexadecimal digits. Pick the next unused HH value for the VG you're importing.

 

- create the /dev/<vg_name>/group device with the chosen minor device number: mknod /dev/<vg_name>/group c 64 0xHH0000.

 

(If you don't create the /dev/<vg_name> directory and the group device before importing a VG, an up-to-date HP-UX 11.31 system will automatically create the directory and the device for you, automatically choosing an unused device number. The older HP-UX versions won't do that, and the above method allows you to assign a specific device number.)

 

Then, actually import the VG:

vgimport -m <vg_name>.map -N -v -s <vg_name>

If the system has a lot of disks, the import operation will take a while.

 

If the vgimport is successful, the VG has been moved and you can activate it with "vgchange -a y <vg_name>" and start setting up mount points for it as usual.

 

Post-move clean-up:

On the 11.23 system, the moved LUNs should now be in NO_HW state in "ioscan -fnCdisk" listing.

You should then run "vgexport -v -s -m <vg_name>.map <vg_name>" (this time without the -p option) to remove the VG information from the 11.23 LVM configuration. As a side effect, you will get another copy of the map file; you can delete it if you are not planning to move the VG back to the 11.23 system. Then use the rmsf command to remove the NO_HW disks from the 11.23 hardware configuration.

 

Rollback:

If something goes wrong and you cannot activate the VG on the 11.31 system, just tell the NetApp admin to map the LUNs back to the 11.23 server, activate the on the 11.23 server, mount the filesystems and/or start the databases and you're back where you started.

MK
Please use plain text.
Super Advisor
NDO
Posts: 533
Registered: ‎12-10-2003
Message 4 of 10 (599 Views)

Re: how to move whole volume group from server A to server B

Hi

 

Thanks a lot to all, I will test this on development server first, them let you know.

Please use plain text.
Super Advisor
NDO
Posts: 533
Registered: ‎12-10-2003
Message 5 of 10 (588 Views)

Re: how to move whole volume group from server A to server B

 

 

Hi!

 

These are the steps that I took:

 

on server A:

 

umount /testomove

vgexport -v -s -p -m /tmp/vg06.map /dev/vg06

vgchange -a n /dev/vg06

copy file to other server (B)

Then on server B:

 

ll /dev/*/group

cd /dev

mkdir vg07

mknod /dev/vg07/group c 64 0x070000

vgimport -m /tmp/vg06.map -N -v -s /dev/vg07

vgchange -a y /dev/vg07

vgdisplay /dev/vg07 | more

mkdir from21

 

mount /dev/vg07/lvol1 /from21

 

BUT when I compare what I have on server A, the copied directory:

 

mcelbill[381]/tmp/fr #du -sk
468856  .
mcelbill[382]/tmp/fr #ls | wc -l
80
mcelbill[383]/tmp/fr #

 

And the destination server B:

 

mcel_VMhost2[1446]/from21 #du -sk
452721  .
mcel_VMhost2[1447]/from21 #ls | wc -l
58
mcel_VMhost2[1448]/from21 #
mcel_VMhost2[1448]/from21 #

 

What could have gone wrong?

 

Please use plain text.
Acclaimed Contributor
Torsten.
Posts: 23,212
Registered: ‎10-02-2001
Message 6 of 10 (586 Views)

Re: how to move whole volume group from server A to server B

Your steps are not consistent (mount points testomove vs. /tmp/fr etc.), but I guess this is intended.

Hopefully you don't activate the VG on both servers the same time?

Usually you "move" the complete VG including all data from one server to the other.

Hope this helps!
Regards
Torsten.

__________________________________________________

There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________

No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! star in the left column!   
Please use plain text.
Super Advisor
NDO
Posts: 533
Registered: ‎12-10-2003
Message 7 of 10 (584 Views)

Re: how to move whole volume group from server A to server B

I copied files from /tmp/fr to /testomove, on the source server, for them to vgexport vg06 which has /testomove  file system, and on the target system I was hoping to see all the files that were on /testtomove on source to be in /from21. Before I runned the vgimport on target I deactivate vg06 on source server. So I should be seing exactly the same files

Please use plain text.
Acclaimed Contributor
Torsten.
Posts: 23,212
Registered: ‎10-02-2001
Message 8 of 10 (583 Views)

Re: how to move whole volume group from server A to server B

Yes, if *all* files are copied from /tmp/fr to /testtomove.

Did you check that?

Maybe there were some temporary files not copied?

Hope this helps!
Regards
Torsten.

__________________________________________________

There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________

No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! star in the left column!   
Please use plain text.
Super Advisor
NDO
Posts: 533
Registered: ‎12-10-2003
Message 9 of 10 (581 Views)

Re: how to move whole volume group from server A to server B

You could be right, because I did not check, I will have star all over again

Please use plain text.
Super Advisor
NDO
Posts: 533
Registered: ‎12-10-2003
Message 10 of 10 (574 Views)

Re: how to move whole volume group from server A to server B

Hi All!

 

After starting all over again, it worked out nice, thank you to all, I will now assign points

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation