From daac7a7b86019244df1088d895ceba0da66a4e33 Mon Sep 17 00:00:00 2001 From: nott Date: Wed, 21 Sep 2011 17:47:37 +0000 Subject: [PATCH] sample script to set rootvg mirroring on AIX git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10591 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/aixvgsetup | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 xCAT/postscripts/aixvgsetup diff --git a/xCAT/postscripts/aixvgsetup b/xCAT/postscripts/aixvgsetup new file mode 100755 index 000000000..c97cfd19a --- /dev/null +++ b/xCAT/postscripts/aixvgsetup @@ -0,0 +1,59 @@ +#!/bin/sh +# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html +# +#--------------------------------------------------------------------------- +# +# aixvgsetup +# +# This sample script may be used to setup up disk mirroring on an +# AIX diskfull node. +# +# It assumes that rootvg is currently on hdisk0 and that the mirror will +# be stored on hdisk1. You can change the disk names to suit your +# environment. +# +# Add this script as a postscript to be run during the initial installation +# of an AIX diskfull (standalone) installation. +#--------------------------------------------------------------------------- + +# extend the root volume group with the new disk(s) +cmd="/usr/sbin/extendvg rootvg hdisk1" +result=`$cmd 2>/dev/null` +rc=$? +if [ $rc -ne 0 ]; then + logger -t xCAT "Could not run $cmd, error = $rc" + echo "Could not run $cmd, error = $rc" + exit 1 +fi + +# create the mirror +cmd="/usr/sbin/mirrorvg rootvg hdisk1" +result=`$cmd 2>/dev/null` +rc=$? +if [ $rc -ne 0 ]; then + logger -t xCAT "Could not run $cmd, error = $rc" + echo "Could not run $cmd, error = $rc" + exit 1 +fi + +# create a boot image +cmd="/usr/sbin/bosboot -ad /dev/hdisk1" +result=`$cmd 2>/dev/null` +rc=$? +if [ $rc -ne 0 ]; then + logger -t xCAT "Could not run $cmd, error = $rc" + echo "Could not run $cmd, error = $rc" + exit 1 +fi + +# set the bootlist +cmd="/usr/bin/bootlist -m normal hdisk0 hdisk1" +result=`$cmd 2>/dev/null` +rc=$? +if [ $rc -ne 0 ]; then + logger -t xCAT "Could not run $cmd, error = $rc" + echo "Could not run $cmd, error = $rc" + exit 1 +fi + +exit 0