Unix OS Shell script AIX Mirror root disk

** Myself
#Mirroring the rootvg Volume Group for AIX
#--------------------------------------------------------------------------------
#  1. Extend rootvg to ${SEC_DISK}:
PRI_DISK=hdisk0
SEC_DISK=hdisk1
extendvg rootvg ${SEC_DISK}
#
# Command reduce vg is
# reducevg rootvg ${SEC_DISK}
#
#  2. Disable QUORUM, by running the following:
chvg -Qn rootvg
#  3. Mirror the logical volumes that make up the AIX operating system:
#             mklvcopy hd1 2 ${SEC_DISK}            #  /home file system
#             mklvcopy hd2 2 ${SEC_DISK}            #  /usr file system
#             mklvcopy hd3 2 ${SEC_DISK}            #  /tmp file system
#             mklvcopy hd4 2 ${SEC_DISK}            #  / (root) file system
#             mklvcopy hd5 2 ${SEC_DISK}            #  blv, boot logical volume
#             mklvcopy hd6 2 ${SEC_DISK}            #  paging space(if the user has other paging devices, rootvg and non-rootvg, they
#             must also mirror those logical volumes in addition to hd6)
#             mklvcopy hd8 2 ${SEC_DISK}            #  file system log
#             mklvcopy hd9var 2 ${SEC_DISK}         #  /var file system
#     If hd5 consists of more than one logical partition, then after  mirroring hd5 the user must verify that the mirrored copy of hd5
#     resides on contiguous physical partitions. This can be verified with    the command:
#                     lslv -m hd5
#
#     If the mirrored hd5 partitions are not contiguous, then the user must delete the mirror copy of hd5 (on ${SEC_DISK}) and rerun the mklvcopy for
#     hd5 using the "-m" option. The user should consult documentation on the usage of the "-m" option for mklvcopy.
ldisk=$(ls /dev/hd[1-9]* |cut -d "/" -f 3)
for i in $ldisk
do
    mklvcopy $i 2 ${SEC_DISK}
done
# Command unmirror rootvg is  (and turn on quorum after reboot)
# unmirrorvg rootvg ${SEC_DISK} 
#  4. Synchronize the newly created mirrors:
syncvg -v rootvg
#  5. Bosboot to initialize all boot records and devices:
bosboot -ad ${SEC_DISK}
#  6. Initialize the boot list:
bootlist -om normal ${PRI_DISK} ${SEC_DISK}
#  7. Shutdown and reboot the system:
shutdown -Fr

0 comments:

Loading