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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I Switch to Mirrored Rootvg Disk w/o Rebooting? 1

Status
Not open for further replies.

labman53

Programmer
Sep 9, 2003
4
US
I have a nagging suspicion that I'm asking for the moon here...

Let's say I notice that my hdisk0 looks like it's about to
die. If I had previously mirrored my rootvg onto another
internal hard drive (hdisk1), is there any way for me to
tell AIX to keep running, but use hdisk1 for everything
that it was using hdisk0 for? Of course that would be
great because I could hot swap hdisk0, and my users
would be none the wiser. But that's probably too good
to be true, right?
 
unmirror the rootvg and just have rootvg on hdisk1. Then clear the boot image from hdisk0 and reduce the rootvg with hdisk0.

unmirror rootvg hdisk0
chpv -c hdisk0
reducevg rootvg hdisk0
rmdev -dl hdisk0 (of course if you reboot hdisk0 will come back, so the system should be shutdown and hdisk0 replaced)

As far as the hot swap of the drive, it would depend on what type of disk.
 
Thanks donttreadonme! That's just what I needed.
 
Hi,

We use the following script for unmirroring the one of the rootvg disks:
===========================
#!/bin/ksh
############################################################
# This script unmirrors the system disk
# The script will be activated by the engineer that configures the system after one of the mirror disks failure
# The scripts displays the disks which are part of the rootvg and lets the user to select one of them as target.
# Usage: unmirrordisk.sh
###########################################################################################
#set -x

DATE1=`date`
DATE2=`date +%m%d%H%M%y`
LOGFILE=”/scitex/version/logs/unmirrordisk.log”

echo “###################################################################“ > $LOGFILE
echo “-------This is a unmirrordisk.sh log file from $DATE1-------------------“ >> $LOGFILE
echo “###################################################################“ >> $LOGFILE

select_destination ()
{
#Display all disks that belong to rootvg
#let the user to choose the one he wants to unmirror
lspv |grep rootvg|awk '{ print $1 }' > /tmp/target_disk
integer A=1
for I in `cat /tmp/target_disk`
do
free_hdisk[A]=$I
A=$A+1
done
A=$A-1

if [[ $A = 1 ]] ;then
echo “\nNo target disks are available in the system !\n” |tee -a $LOGFILE
exit 1
fi

echo "---------------------------------------------------" |tee -a $LOGFILE
echo “The following disks are part of rootvg.”
printf -- "\nSelect the destination disk that you want to unmiror: [] \n\n"
PS3="choose >>"
select DEST_DISK in ${free_hdisk[*]}
do
if [[ -z $DEST_DISK ]] ;then
printf -- "\n\tChoose the right number !\n\n"
else
break
fi
done

echo “\nThe disk that will be unmirrored is $DEST_DISK” |tee –a $LOGFILE

#check which disk is the good rootvg disk
SOURCE_DISK=`lspv|grep rootvg|awk '{ print $1 }’ |grep –v $DEST_DISK`
echo “The good disk is $SOURCE_DISK” |tee –a $LOGFILE
}

while true
select_destination
do
echo "\nContinue with the about selection ? (y/n) [Y]:\c"
read answer
if [[ $answer = [Yy] ]] || [[ -z $answer ]] ;then
break
elif [[ $answer = [Nn] ]] ;then
:
else
echo "\n Please answer y/n only !\n"
fi
done

trap 'echo “This operation may not be interrupted !”' 1 2 3 15
#now UNMIRROR rootvg
echo “\nNow unmirroring rootvg. This may take several minutes . . .\n” |tee –a $LOGFILE
unmirrorvg rootvg $DEST_DISK |tee –a $LOGFILE 2>&1
if [[ $? -ne 0 ]] ;then
echo "\nCan not unmirror rootvg to the destination disk $DEST_DISK" |tee –a $LOGFILE
exit 1
fi

# RUNNING bosboot FOR BOOT DISK
echo “\nNow running bosboot. This may take several minutes . . .” |tee –a $LOGFILE
bosboot -a -d /dev/$SOURCE_DISK |tee –a $LOGFILE 2>&1
if [[ $? -ne 0 ]] ;then
echo "\nCan not create bosboot on the source disk $SOURCE_DISK" |tee –a $LOGFILE
exit 1
fi

#BOOTLIST WILL BE DEFINED NOW
echo “\nNow removing the $DEST_DISK from the bootlist” |tee –a $LOGFILE
bootlist -m normal $SOURCE_DISK |tee –a $LOGFILE 2>&1
if [[ $? -ne 0 ]] ;then
echo "\nCan not remove the destination disk $DEST_DISK from the bootlist” |tee –a $LOGFILE
exit 1
fi

#Start REDUCEVG rootvg
echo “\nNow reducing the rootvg” |tee –a $LOGFILE
reducevg rootvg $DEST_DISK |tee –a $LOGFILE 2>&1
if [[ $? -ne 0 ]] ;then
echo "\nCan not reduce rootvg" |tee –a $LOGFILE
exit 1
fi

#QUORUM will be changed to on
echo “\nNow switching on the Quorum” |tee –a $LOGFILE
chvg -Q 'y' rootvg |tee –a $LOGFILE 2>&1
if [[ $? -ne 0 ]] ;then
echo "\nCan not switch on the Quorum on rootvg !” |tee –a $LOGFILE
exit 1
fi

trap - 1 2 3 15

echo “\nThe unmirroring of the system disk was successfully completed !\n” |tee –a $LOGFILE
echo “\nSee $LOGFILE for detailes !” |tee –a $LOGFILE
echo “###################################################################“ >> $LOGFILE

#If it’s 6F1 – use HOTSWAP manager to remove the disk, else – rmdev manually.
if [[ `uname -M|cut -d"-" -f2` = “6F1” ]] ;then
echo “\nAfter your next \”ENTER\” the $DEST_DISK disk will start blinking”
echo “\nPress ENTER when ready and wait for the instructions to replace the disk :\c”
read ANSWER
diag –c –d $DEST_DISK -T"identifyRemove –a remove"
cfgmgr
else
echo “”
echo ‘Please run ” rmdev –dl $DEST_DISK ” before removing the faulty disk !!!’
fi

echo “\n###################################################################“ |tee –a $LOGFILE
echo “\nThe unmirroring procedure was successfully completed !“ |tee –a $LOGFILE
echo “\n###################################################################“ |tee –a $LOGFILE


"Long live king Moshiach !"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top