Listing EMC power path disks without root

Here’s a short script to list all power path disks and the hdisks that make them up.

lspv | grep hdiskp | awk '{print $1}' | while read pv
do
   serial=$(odmget -q name=$pv CuVPD|tr "*" "\n"|grep SN)
   sserial=${serial##*SN}
   echo $pv : $sserial : $(lspv |grep "$pv " | awk '{print $2}') - consists of ...
      for i in $(lspv |grep hdisk | grep hdiskpower | awk '{print $1}')
      do
         hdiskserial=$(odmget -q name=$i CuVPD| tr "*" "\n"| grep SN)
         hserial=${hdiskserial##*SN}
         if [ $sserial = $hserial ]; then
            echo "\t$i"
         fi
      done
done

Boom.

About

I'm a freelance UNIX engineer working in the UK. I'm married to Tina and between us we have six children. I'm a bit of an Apple fan boy, and all the Windows machines in the house are a thing of the past now.

Posted on October 14, 2013, 3:30 am By
Categories: AIX Tags: , ,
%d bloggers like this: