Script to list disks Info

Hello Everybody,

The following lines are a for loop script to display disks info @ AIX System (Disk Name, Disk Unique ID, Disk Size in MB) and of course you can customize the data by add more columns:

TEST_Server# for i in `lspv |awk '{print $1}'`
do
      disk=$i
      serial=`lscfg -vpl $disk 2>/dev/null|grep "Serial"|tr "." " "|awk '{print $3}'`
      size=`bootinfo -s $disk`
      echo $disk"\t\t"$serial"\t"$size"\t"
done|sort -k 6

and the output will be like the following:

hdisk0          600507680181065F2000000000001119        102400
hdisk1          600507680181065F200000000000111F        256000
hdisk10         600507680181065F2000000000001124        262144
hdisk11         600507680181065F2000000000001125        256000
hdisk12         600507680181065F2000000000001126        256000
hdisk13         600507680181065F2000000000001127        256000
hdisk14         600507680181065F2000000000001128        256000
hdisk15         600507680181065F2000000000001129        256000
hdisk16         600507680181065F200000000000112A        256000
hdisk17         600507680181065F200000000000112B        256000

Have a nice day 🙂

This entry was posted in AIX, Shell Script and tagged , , , , , , , , . Bookmark the permalink.

Comments are closed.