Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

splitting mirrored disks for migration 1

Status
Not open for further replies.

mkharris

Technical User
Nov 20, 2000
104
GB
Hi. I have a question for anyone who is a bit of a whiz with LVM. What I want to do is take a volume group of SSA disks, and replicate their contents onto another RS6000, in the minimum cut-over time possible.
The way I want to achieve this, is by mirroring the disks, splitting the mirror, and then importing the split copies on the other system. I have worked out a way of doing this, and when I test it on a small vg, it works fine. My main concern that is it might be a bit of a kludge, and more risky with large volumes of data. Also, there might be a
quicker, more correct way of doing this. Any input gratefully received. Here is how I do it:

Find out which disks belong to which lv with:
host1:/>lsvg -l Lvname |tail +3|awk '{print $1}' |xargs -n 1 lslv -l

Add new disks to group:
host1:/> extendvg Vgname hdiskn hdiskn+1 etc

Turn quorum checking off, otherwise problems will occur later when disks are removed:
host1:/> chvg -Qn Vgname

make mirrors:
host1:/> mklvcopy Lvname 2 hdiskn hdiskn+1

Sync all copies with:
host1:/> syncvg -v Vgname

On host1, unmount the filesystems associated with the vg.

Convert mirrors into separate lvs with:
host1:/> splitlvcopy -y newlv oldlv 1
( Make sure that the newlv name will be unique on both systems )

Power off all SSA disks used as copies.

Remove disks and their lv's from the vg:
host1:/> reducevg -d Vgname hdiskn hdiskn+1 etc

Remove disks from device configuration database:
host1:/> rmdev -d -l hdiskn
host1:/> rmdev -d -l pdiskn

Re-instate quorum checking:
host1:/> chvg -Qy Vgname

Remount filesystems associated with the vg, and ensure contents are fully accessible.

On host2, cable in SSA disks, and power back on again.

Update device database with new disks after checking beforehand that you know what disks are already there.
host2:/>cfgmgr

Import the volume group, but use force mode, as not all disks / lv's will be present ( synclvodm warnings will appear ):
host2:/> importvg -f -y Vgname hdiskn

Turn quorum checking off for Vgname with:
host2:/> chvg -Qn Vgname

Find the disks that used to be present in the vg, but which were not cabled across:
host2:/> lsvg -p Vgname

Remove the disks that show as removed ( from last step ) from the vg with:
host2:/> reducevg -d Vgname hdiskn hdiskn+1 etc

Re-instate quorum checking:
host2:/> chvg -Qy Vgname

Make sure that that the logical volumes in the vg have the expected filesystems associated with them:
host2:/> lsvg -l Vgname
If any are missing / incorrect, they will need to be recreated as they are on host1.

Check consistency across imported filesystems with:
host2:/> lsvg -l Vgname |tail +3|awk '{print $7}' | grep -v "N/A" |xargs -n 1 fsck

On host2, remount filesystems associated with the vg, and ensure contents are fully accessible.

That's it. Something tells me there's an easier way....

TIA
Mark Harris
 
Are you looking to have it up to date and constantly update it? or a one shot deal?

If one shot deal...I would do a savevg datavg and just restore to the new system
The savevg will have the size of your logical volumes...
It will save you work and possibly time as well...


Yes you can do what you want your way, but I don't see why? Maybe I am missing something...let me know more info if you need it.
 
Thanks for the reply :). This is a one shot deal - I need to provide a hot standby duplicate of this system whilst it is unplugged and moved elsewhere. Doing a savevg would take too long - we are talking over 200 gb of data, and the copy needs to take minutes rather than hours. I know that syncing mirrors will also take a long time, but this can all happen while the data is being accessed / updated by the live application. Then it's just a case of recabling and importing.

So, I'd still like to do this using mirroring, but if I can avoid using splitlvcopy and do it with something like rmlvcopy in a less complicated way, so much the better.

Thanks
Mark
 
We did our migration this way, splitting over 400 Gb of data and keep up a sleeping copy. We also used this stuff to "copy" datas to another system. We didnt use the splitlvcopy as it is a unecessary step :
assuming mirroring is up and running ...
umount fs + varyoffvg,
rmdev -l halfofpvs ( the one we want to keep the copies on)
varyonvg -f vg (x pv removed)
mount fs
rmlvcopy lv 1 hdiskx hdisky (all the removed pv)
reducevg vg hdiskx hdisky

On the other system :
rmdev -l hdiskz hdiska (the disks up on the other sys)
importvg -y vg1 hdiskx (-f if only one pv depending on the quroum)
rmlvcopy lv 1 hdiskz
reducevg vg1 hdiskx
mount ...

this worked quite well on aix432.
 
Thank you, gileb. This is exactly what I was hoping for. I wasn't happy having my database on the 'clone' system with different lv names, and as you suggest, the splitlvcopy is an unnecessary step. It's also helpful to know you have used this in practice on large data volumes - I can only run limited, smaller tests.
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top