Tuesday, May 12, 2009

Solaris How to find LUN id of disks

#format ....

54. c4t50060E8003EC2D000000EC2D00001015d0
/scsi_vhci/ssd@g50060e8003ec2d000000ec2d00001015
55. c4t50060E8003EC2D000000EC2D00001017d0
/scsi_vhci/ssd@g50060e8003ec2d000000ec2d00001017
56. c4t50060E8003EC2D000000EC2D00001019d0
/scsi_vhci/ssd@g50060e8003ec2d000000ec2d00001019
[03:49:39] root@episprod[64]# luxadm probe | grep c4t50060E8003EC2D000000EC2D000 01015d0
Logical Path:/dev/rdsk/c4t50060E8003EC2D000000EC2D00001015d0s2
64 luxadm probe | grep c4t50060E8003EC2D000000EC2D00001015d0
65 luxadm display /dev/rdsk/c4t50060E8003EC2D000000EC2D00001015d0s2

[03:49:39] root@episprod[65]# k/c4t50060E8003EC2D000000EC2D00001015d0s2 <
DEVICE PROPERTIES for disk: /dev/rdsk/c4t50060E8003EC2D000000EC2D00001015d0s2
Vendor: HP
Product ID: OPEN-E -SUN
Revision: 2114
Serial Num: 0450EC2D1015
Unformatted capacity: 13893.047 MBytes
Write Cache: Enabled
Read Cache: Enabled
Minimum prefetch: 0x0
Maximum prefetch: 0x0
Device Type: Disk device
Path(s):

/dev/rdsk/c4t50060E8003EC2D000000EC2D00001015d0s2
/devices/scsi_vhci/ssd@g50060e8003ec2d000000ec2d00001015:c,raw
Controller /devices/pci@8,600000/SUNW,qlc@1/fp@0,0
Device Address 50060e8003ec2d05,14 <---------- this is the LUN id in HEX
Host controller port WWN 210000e08b81fdfa
Class primary
State ONLINE
Controller /devices/pci@8,600000/SUNW,qlc@2/fp@0,0
Device Address 50060e8003ec2d15,14 <---------- this is the LUN id in HEX
Host controller port WWN 210000e08b8180fb
Class primary
State ONLINE

Friday, May 8, 2009

Solaris which disk we are booting from?

root # prtpicl -v | grep disk
:disk-write-fix
disk-label (disk-label, 3a00000033)
:devfs-path /packages/disk-label
:binding-name disk-label
:_class disk-label
:name disk-label
:bootpath /pci@1c,600000/scsi@2/disk@1,0:a <----- disk1
:boot-device disk0:a
:diag-device disk0:a
:disk /pci@1c,600000/scsi@2/disk@0,0
:disk0 /pci@1c,600000/scsi@2/disk@0,0
:disk1 /pci@1c,600000/scsi@2/disk@1,0
:disk2 /pci@1c,600000/scsi@2/disk@2,0
:disk3 /pci@1c,600000/scsi@2/disk@3,0
:SlotType disk-slot
disk (fru, 3a0000b366)
:name disk
:SlotType disk-slot
disk (fru, 3a000006df)
:name disk
:SlotType disk-slot
:SlotType disk-slot
root #

UNIX: How to print column nicely using printf

[user@hostfwnms1-oam tmp]# cat b.sh printf "%-26s %-19s %-8s %-8s %-s %-s\n" HOSTNAME IP PING SNMPWALK 0-ok 1-fail for i in `cat n...