Unsolved
This post is more than 5 years old
63 Posts
0
11695
October 24th, 2007 06:00
removing a hdiskpower device in aix
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
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
No Events found!


croyer2
7 Posts
0
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
emcers
63 Posts
0
October 25th, 2007 10:00
thanks for the help. i have a question on your steps:
3. powermt remove dev=#
4. rmdev -Rdl hdiskpower#
doesnt powermt remove dev=#, that removes the hdiskpower device, so why you need the rmdev -Rdl hdiskpower?
croyer2
7 Posts
0
October 29th, 2007 08:00
This command just removes the device from PowerPath control. The device is still in the AIX ODM.
rmdev -Rdl hdiskpower#
This command actually removes the device from the AIX ODM. This is necessary if you want to deallocate the device from the host.
I hope this helps.
-Chuck
OF-JuQGM
1 Message
0
November 19th, 2007 22:00
Just one thing tho' you might want to deallocate the device from the Symm/Clariion, or it'll be back at the next cfgmgr.