Operating System - HP-UX
1830830 Members
2650 Online
110017 Solutions
New Discussion

moving vg from san disk to new san disk

 
schinwari
Occasional Advisor

moving vg from san disk to new san disk

Hi,

what is the best way to move data (volume group) from a san disk to a new san disk.
is there any possibility to move the entire volume group to onther disk.
or do i have to create new volume group on new disk and copy all data manualy ?

thanks
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: moving vg from san disk to new san disk

Shalom,

Best: Shut down the applications using the data, do a full backup. Restore that backup after new SAN volume is ready and has a filesystem on it.

You can save time with an scp -rp copy.

There is no such command as vgmove.

You could try and use SAN utilities to replicate the data if the two SAN's are compatible.

Taking the vgexport and vg configuration of the old and moving it to the new might cause limitations as well. The new one might be bigger and the volume group might not be correct for the new SAN.

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
SKR_1
Trusted Contributor

Re: moving vg from san disk to new san disk

If you want to move whole data from one disk to another disk, you can use pvmove command.
Ivan Krastev
Honored Contributor

Re: moving vg from san disk to new san disk

Hello Azimi,

If your VG is located on 1,2,3,4 ... and yuu want to move it to 10,11,12 you can do the following:

1. present new disks(11,12,13) to server
2. extend VG over new disks
3. remove old disks(1,2,3..) from VG


regards,
ivan
Patrick Wallek
Honored Contributor

Re: moving vg from san disk to new san disk

>>1. present new disks(11,12,13) to server
>>2. extend VG over new disks
>>3. remove old disks(1,2,3..) from VG


I think you're missing some steps between 2 & 3. Just extending the VG to contain the new disks does absolutely nothing for moving the data.

A step 2A would be to use PVMOVE or MIRRORING to migrate the data.

If you use PVMOVE:

2A. PVMOVE Data from old disks to new disks

If you use Mirroring:

2A. lvextend mirrors onto new disks.
2B. lvreduce mirrors from old disks.
Adam Winebaugh
Regular Advisor

Re: moving vg from san disk to new san disk

I agree with patrick on this. I liek to use mirroring as a way to move data. It is fast, reliable and has few points were anything can go wrong. I did this not 3 weeks ago on 3 vg's. It worked wonderfully.
Uday_S_Ankolekar
Honored Contributor

Re: moving vg from san disk to new san disk

If you are able connect and use both SAN simultaneously then you can use vgextend and lvreduce the way it explained above posts.
If you cannot then,
Full backup from Current SAN
Once you connect new SAN Storage, run vgcfgrestore from old disk to new disk and then vgimport map file. We can use one from /etc/lvmconf (This will restore all lvols )

Run Newfs , mount filesytems and Restore from Backup.

I just went through a major SAN disaster and used above approach!

-USA..
Good Luck..
Tim Nelson
Honored Contributor

Re: moving vg from san disk to new san disk

All past SAN migrations I used Mirror/UX to transparently copy data from one to another.

present new disk to vg
lvextend to the new disk
lvreduce the old disk
vgreduce the old disk

Done.. no one will ever know it happened.
( do this off-peak to avoid IO bandwidth issues if your app is a busy one ).



schinwari
Occasional Advisor

Re: moving vg from san disk to new san disk

Hello ,

Thanks for you anwsers .

In the mean time i have done following:
1. pvcreate new disk then created new VG and Lv on new disk
2. on the coming weekend in willshutdown the oracle and other applications and then copy all data from old Lv to new LV.

Time Nelson soultions sounds very easy and can it be done online ? and please explain your solution more deatiled

thanks in advance

regards
Torsten.
Acclaimed Contributor

Re: moving vg from san disk to new san disk

If you want to *copy* your data take care of file permissions and ownership! It may be better to backup and restore the data.

To Tim's solution:
(I try to extend it a bit).

1. present new disk to server
2. vgextend the vg with the new disk (pvcreate, vgextend)
3. "lvextend -m 1 ..." the lvols to the new disk (build a mirror between the old and new array - depending on your system config the new disks should have the same size as the old)
4. lvreduce the lvols from old disk (remove the mirror from the old disk)
5. vgreduce the old disk

You are done with this magic move.

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! thumb below!   
Fabien GUTIERREZ
Frequent Advisor

Re: moving vg from san disk to new san disk

apart from specific tools between arrays to copy data if your lun have the same size you can mirror the data within the same vg
if there are differences stop all accesses to data copy via tar cp or even dd between lv in both differents vg then switch and start all up