ONLINE DISK Migration / mirror of AIX server

 


Hello everyone... not write down an article for long time with no reason, now i present to you an article about migrating disk with mirror method. this method is used on AIX 6.1 using SAN storage as it's disk. we will mirror disk on SAN 1 to disk on SAN 2
and ones again, for your information, new disk we call hdisk1 and present disk we call hdisk0 

this environment is allready installed with Multipath driver from storage vendor like EMC.AIX.5.3.1.0-xtremIO-driver-mpio (installaing this driver need AIX reboot to detect multipath ) .

let's start it

--1--
add new disk to existing VG
 [darkonsole@AIX_LPAR]/> extendvg db2vg hdisk1

--2--
simpli mirror the disk with this following command
 [darkonsole@AIX_LPAR]/> mirrorvg -S -m db2vg hdisk1

  Use The ‘-S’ option  (Uppercase ‘S’)  for Background sync  
 

If all looks good at this point and the sanity checks are good, mirror is working.
You need to use the force option when bringing it into rootvg.

[darkonsole@AIX_LPAR]/> extendvg -f rootvg hdisk1
[darkonsole@AIX_LPAR]/> mirrorvg rootvg hdisk1

--3--

chek mirror progres using this command
[darkonsole@AIX_LPAR]/> lsvg db2vg | grep STALE

or with script :

#!/usr/bin/ksh93
### W.M. Duszyk, 3/2/12
### AVandewerdt 01/05/14
### show percentage of re-mirrored PPs in a volume group
 [[ $# < 1 ]] && { print "Usage: $0 vg_name"; exit 1; }
vg=$1
printf "Volume Group $vg has ";lsvg -L $vg | grep 'ACTIVE PVs:' | awk '{printf $3}';printf " copies "
Stale=`lsvg -L $vg | grep 'STALE PPs:' | awk '{print $6}'`
[[ $Stale = 0 ]] && { print "and is fully mirrored."; exit 2; }
Total=`lsvg -L $vg | grep 'TOTAL PPs:' | awk '{print $6}'`
PercDone=$(( 100 - $(( $(( Stale * 50.0 )) / $Total )) ))
echo "and is mirrored $PercDone%."
exit 0


--4--
when it'a all done, then we can un-mirro and remove old disk

for un-mirroring disk and remove from VG, run bellow command

[darkonsole@AIX_LPAR]/> unmirrorvg db2vg hdisk0
 0516-1804 chvg: The quorum change takes effect immediately.
[darkonsole@AIX_LPAR]/> lspv -l hdisk0
[darkonsole@AIX_LPAR]/> reducevg db2vg hdisk0

then remove the disk from server

[darkonsole@AIX_LPAR]/># rmdev -dl hdisk0

all done now. and you can go on with your life again

Previous
Next Post »

comment please ... ConversionConversion EmoticonEmoticon

Thanks for your comment