what's the correct process to remove a hdiskpower device in aix?
1. unmount filesystems
2. delete the logical volume
3. delete the log volume for the volume group
4. remove the volume group
5. finally delete the hdiskpower
You first need to do whatever steps are necessary to get the hdiskpower device out of the volume group. This may not necessarily involve steps 1-4. You could just perform a "reducevg" operation.
Once the hdiskpower device is out of the VG, perform the following steps to remove the device from AIX completely.
1. powermt display dev=# (where # is the hdiskpower number) 2. make note of the hdisk devices for this hdiskpower device 3. powermt remove dev=# 4. rmdev -Rdl hdiskpower# 5. rmdev -Rdl hdisk# (do this for each of the hdisks you recorded in step 2)
I use the script below to remove hdiskpower devices from an AIX host. It takes a file with one or more hdiskpower device names as input. It also records the storage system ID and device ID (Symm and Clariion only) for reference when you go to reclaim the storage on the array(s).
#!/bin/ksh
# Script to remove all PowerPath devices and their child # hdisks.
# Usage: mkclean < devlist # # Where: # # devlist: List of hdiskpower devices, one per line
# Read each Powerpath device from the input file and determine # the child hdisks. Also record the storage array serial number # and array device ID for later array maintenance.
if [ -f `pwd`/arrayinfo.txt ] then rm `pwd`/arrayinfo.txt fi HDISKLIST="" TMPFILE=`pwd`/pptmp.txt while read POWDEV do
powermt display dev=$POWDEV > $TMPFILE grep "Symmetrix ID" $TMPFILE > /dev/null if [ $? -eq 0 ] then
# This is a Symmerix device so get the SN and LVID
grep "Symmetrix ID" $TMPFILE | read LINE SN=${LINE##*=} grep "Logical device ID=" $TMPFILE | read LINE LUN=${LINE##*=} print "$SN $LUN" >> arrayinfo.txt grep fscsi $TMPFILE | while read f1 f2 HDISK rest do HDISKLIST="$HDISKLIST $HDISK" done
# Now remove the devices from the host
powermt remove dev=$POWDEV rmdev -Rdl $POWDEV for HDISK in $HDISKLIST do rmdev -Rdl $HDISK done
else
# This is a Clariion device so get the SN and LUN ID
grep "CLARiiON ID" $TMPFILE | read LINE SN=${LINE##*=} SN=${SN%% \[*} grep "Logical device ID=" $TMPFILE | read LINE LUN=${LINE##*LUN } LUN=${LUN%\]} print "$SN $LUN" >> arrayinfo.txt grep fscsi $TMPFILE | while read f1 f2 HDISK rest do HDISKLIST="$HDISKLIST $HDISK" done
# Now remove the devices from the host
powermt remove dev=$POWDEV rmdev -Rdl $POWDEV for HDISK in $HDISKLIST do rmdev -Rdl $HDISK done fi
croyer2
7 Posts
3749
0
Posted October 24th, 2007 08:00
You first need to do whatever steps are necessary to get the hdiskpower device out of the volume group. This may not necessarily involve steps 1-4. You could just perform a "reducevg" operation.
Once the hdiskpower device is out of the VG, perform the following steps to remove the device from AIX completely.
1. powermt display dev=# (where # is the hdiskpower number)
2. make note of the hdisk devices for this hdiskpower device
3. powermt remove dev=#
4. rmdev -Rdl hdiskpower#
5. rmdev -Rdl hdisk# (do this for each of the hdisks you recorded in step 2)
I use the script below to remove hdiskpower devices from an AIX host. It takes a file with one or more hdiskpower device names as input. It also records the storage system ID and device ID (Symm and Clariion only) for reference when you go to reclaim the storage on the array(s).
#!/bin/ksh
# Script to remove all PowerPath devices and their child
# hdisks.
# Usage: mkclean < devlist
#
# Where:
#
# devlist: List of hdiskpower devices, one per line
# Read each Powerpath device from the input file and determine
# the child hdisks. Also record the storage array serial number
# and array device ID for later array maintenance.
if [ -f `pwd`/arrayinfo.txt ]
then
rm `pwd`/arrayinfo.txt
fi
HDISKLIST=""
TMPFILE=`pwd`/pptmp.txt
while read POWDEV
do
powermt display dev=$POWDEV > $TMPFILE
grep "Symmetrix ID" $TMPFILE > /dev/null
if [ $? -eq 0 ]
then
# This is a Symmerix device so get the SN and LVID
grep "Symmetrix ID" $TMPFILE | read LINE
SN=${LINE##*=}
grep "Logical device ID=" $TMPFILE | read LINE
LUN=${LINE##*=}
print "$SN $LUN" >> arrayinfo.txt
grep fscsi $TMPFILE | while read f1 f2 HDISK rest
do
HDISKLIST="$HDISKLIST $HDISK"
done
# Now remove the devices from the host
powermt remove dev=$POWDEV
rmdev -Rdl $POWDEV
for HDISK in $HDISKLIST
do
rmdev -Rdl $HDISK
done
else
# This is a Clariion device so get the SN and LUN ID
grep "CLARiiON ID" $TMPFILE | read LINE
SN=${LINE##*=}
SN=${SN%% \[*}
grep "Logical device ID=" $TMPFILE | read LINE
LUN=${LINE##*LUN }
LUN=${LUN%\]}
print "$SN $LUN" >> arrayinfo.txt
grep fscsi $TMPFILE | while read f1 f2 HDISK rest
do
HDISKLIST="$HDISKLIST $HDISK"
done
# Now remove the devices from the host
powermt remove dev=$POWDEV
rmdev -Rdl $POWDEV
for HDISK in $HDISKLIST
do
rmdev -Rdl $HDISK
done
fi
rm $TMPFILE
HDISKLIST=""
done