Re: On replacing a hdisk

From: Chuck Lam (chuck_lam@YAHOO.COM)
Date: Wed Aug 28 2002 - 14:25:34 EDT


Oh,wow, what a wonderful script! Thank you so much.

--- AIX geek <aixgeek@YAHOO.COM> wrote:
> It will come in as the LOWEST available number
> (hdisk2
> in this case). But never fear, just run this script
> when you're done (I've used this for years). It
> even
> has a modicum of error checking (I cut and pasted
> it,
> so be careful of line-wrapping).
>
>
>
> #!/bin/ksh
> # mvhdisk
>
> FILE1=/tmp/mvhdisk.$$
> FILE2=/tmp/mvhdisk2.$$
>
> DIR=/tmp/mvh$$
> mkdir $DIR
> cp /etc/objrepos/Cu* $DIR # Backup the ODM
>
>
> # Functions
>
> disp_usage()
> {
> echo ""
> echo Usage:
> echo "\tmvhdisk Currenthdiskname
> Newhdiskname"
> echo ""
> }
>
> cleanup()
> {
> rm -f $FILE1 $FILE2
> rm -rf $DIR
> }
>
> check_valid_args()
> {
> if [ $LOGNAME != "root" ]
> then
> echo ""
> echo Error: You must be root to run
> this script.
> echo ""
> exit
> fi
>
> if [ $# -ne 2 ]
> then
> echo ""
> disp_usage
> exit
> fi
>
> lspv | grep -q $1
> if [ $? -ne 0 ]
> then
> echo ""
> echo Error: Current disk name does
> not exist in the
> ODM.
> disp_usage
> exit
> fi
>
> lspv | grep -q $2
> if [ $? -eq 0 ]
> then
> echo ""
> echo Error: New disk name already
> exists in the
> ODM.
> disp_usage
> exit
> fi
> }
> # End of functions
> #====================
>
> check_valid_args $*
>
> # Save existing ODM definition
> odmget -q name=$1 CuDv >> $FILE1
> odmget -q name=$1 CuAt >> $FILE1
> odmget -q name=$1 CuVPD >> $FILE1
> odmget -q value3=$1 CuDvDr >> $FILE1
>
> # Delete existing ODM definitions
> odmdelete -q name=$1 -o CuDv > /dev/null 2>&1
> odmdelete -q name=$1 -o CuAt > /dev/null 2>&1
> odmdelete -q name=$1 -o CuVPD > /dev/null 2>&1
> odmdelete -q value3=$1 -o CuDvDr > /dev/null 2>&1
>
> # Change to new definitions
> sed "s/$1/$2/g" $FILE1 > $FILE2
>
> # Add back to ODM
> odmadd $FILE2
>
> # Change /dev entries
> mv /dev/$1 /dev/$2
> mv /dev/r$1 /dev/r$2
>
> cleanup
>
>
>
> --- Chuck Lam <chuck_lam@yahoo.com> wrote:
> > Hi,
> >
> > RS/6000 M80 running 4.3.3
> >
> > I have 'hdisk0' and 'hdisk1' as two internal
> system
> > drives, and I have hdisk11 - hdisk20 for
> > applications.
> > I used to have hdisk2 - hdisk10, but were
> recently
> > removed and deleted. Now I have to replace
> > 'hdisk19'.
> > My question is after I run the 'cfgmgr', will my
> > new
> > disk come up as 'hdisk2' or 'hdisk19'? I prefer
> it
> > to
> > come back as 'hdisk19', because it will be easiler
> > to
> > identify with the rest of the application drives.
> > Any
> > suggestions I can make this happen?
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> http://finance.yahoo.com

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:10 EDT