From Wiki-UX.info

Wiki-UX / Fibre Channel / How to get the size of the disks
Jump to: navigation, search

How to get the size of the disks

Contents

Reference

This article describes some scripts that can be use do report the size of the attached disk drives or logical units (LUN) on a HP-UX 11i Operating Environment.

Simple Script

for rdsk in $(ioscan -fnkC disk | grep rdsk | awk '{print $2}')
do
diskinfo $rdsk | grep -e size -e describe
done

Example:

SCSI describe of /dev/rdsk/c0t0d0:
               size: 527408 Kbytes
SCSI describe of /dev/rdsk/c2t1d0:
               size: 35566480 Kbytes
SCSI describe of /dev/rdsk/c3t0d0:
               size: 35566480 Kbytes
SCSI describe of /dev/rdsk/c3t9d0:
               size: 35566480 Kbytes
SCSI describe of /dev/rdsk/c3t11d0:
               size: 35566480 Kbytes
SCSI describe of /dev/rdsk/c3t13d0:
               size: 35566480 Kbytes
SCSI describe of /dev/rdsk/c3t15d0:
               size: 35566480 Kbytes

Formatted Script

Alternative, the format output can be manipulated a little to facilitate reading.

for disk in `ls /dev/rdsk/*`;
do
   echo $disk `diskinfo $disk | awk -F: '/size/ {print $2}'`
done

Example:

/dev/rdsk/c0t0d0 527408 Kbytes
/dev/rdsk/c2t1d0 35566480 Kbytes
/dev/rdsk/c3t0d0 35566480 Kbytes
/dev/rdsk/c3t11d0 35566480 Kbytes
/dev/rdsk/c3t13d0 35566480 Kbytes
/dev/rdsk/c3t15d0 35566480 Kbytes
/dev/rdsk/c3t9d0 35566480 Kbytes

Authors

This page was last modified on 17 July 2010, at 03:46. This page has been accessed 1,901 times.