rageek

A place for Unix Thoughts and Ideas

HP-UX Disk Device Name Tricks and Info Gathering

Coming from the Solaris world, the old style disk naming convention used in HP-UX v1 and v2 can be confusing.

Here are some quick commands to assist in the task of matching devices to LUN numbers, and general information gathering in HP-UX

Show Volume groups and disks
for i in `vgdisplay 2>1 | grep “VG Name” | awk ‘{print $3}’ | grep -v ‘^vg’ | cut -d/ -f3`; do
printf “Group $i\n”
vgdisplay -v $i | egrep “PV Name|Free PE”
done

List
Group vg00
Free PE 2665
PV Name /dev/dsk/c0t6d0s2
Free PE 2665
Group vg10
Free PE 1640
PV Name /dev/dsk/c2t1d7
PV Name /dev/dsk/c5t1d7 Alternate Link
Free PE 0
PV Name /dev/dsk/c2t2d0
PV Name /dev/dsk/c5t2d0 Alternate Link
Free PE 41
PV Name /dev/dsk/c2t2d1
PV Name /dev/dsk/c5t2d1 Alternate Link
Free PE 1599

List Volume Groups
vgdisplay 2>1 | grep “VG Name” | awk ‘{print $3}’ | grep -v ‘^vg’ | cut -d/ -f3

List Fibre adapter paths
ioscan -kfC fc | awk ‘{ print $3}’ | egrep -v ‘H\/W|^$’
0/3/1/0/4/0
0/3/1/0/4/1
0/7/1/0/4/0
0/7/1/0/4/1

List Fibre Disk Paths Hardware, Device name, and decimal LUN numbers and Lun Size
updated 2/9/11: added LUN size to output

for i in `ioscan -kfC fc | awk ‘{ print $3}’ | egrep -v ‘H\/W|^$’`;do ioscan -knfH $i | egrep ‘dsk|sdisk’ | sed -e ‘$!N;s/\n/ /’ |awk ‘{print $3 “.” $9 “.” $10}’ | perl -ne ‘chomp; split (/\./); printf (“%s %s LUN: %d SIZE: %d GB\n”, @_[0], @_[7], (@_[5]<<3)+@_[6], `diskinfo -b @_[8]`/1024/1024)’ ; done
0/3/1/0/4/0 /dev/dsk/c2t0d0 LUN: 0 SIZE: 10 GB
0/3/1/0/4/0 /dev/dsk/c2t0d1 LUN: 1 SIZE: 10 GB
0/3/1/0/4/0 /dev/dsk/c2t0d2 LUN: 2 SIZE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LUN: 8 SIZE: 10 GB
0/7/1/0/4/0 /dev/dsk/c5t1d1 LUN: 9 SIZE: 10 GB
0/7/1/0/4/0 /dev/dsk/c5t1d2 LUN: 10 SIZE: 10 GB
0/7/1/0/4/0 /dev/dsk/c5t1d3 LUN: 11 SIZE: 10 GB
0/7/1/0/4/0 /dev/dsk/c5t1d4 LUN: 12 SIZE: 50 GB
0/7/1/0/4/0 /dev/dsk/c5t1d5 LUN: 13 SIZE: 50 GB
0/7/1/0/4/0 /dev/dsk/c5t1d6 LUN: 14 SIZE: 50 GB
0/7/1/0/4/0 /dev/dsk/c5t1d7 LUN: 15 SIZE: 100 GB
0/7/1/0/4/0 /dev/dsk/c5t2d0 LUN: 16 SIZE: 100 GB

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: