Operating System - HP-UX
1838251 Members
4384 Online
110125 Solutions
New Discussion

Enumerate S/W State for a raw disk...

 
SOLVED
Go to solution
Gene Laoyan
Super Advisor

Enumerate S/W State for a raw disk...

How do I get the S/W State for my disk '/dev/rdsk/c7t0d1'. I just want the S/W State of either "CLAIMED" or "NO_HW".

Thanks
4 REPLIES 4
Patrick Wallek
Honored Contributor
Solution

Re: Enumerate S/W State for a raw disk...

The easiest way would be to do an ioscan with the '-H' option and specify the hardware path, like '/0/0/1.7.0'.

Something like the following:

/usr/sbin/ioscan -kfH 10/0/15/1.5.0 | tail -1 | awk '{print $5}'

Should return CLAIMED or NO_HW, or whatever the SW State is.
Gene Laoyan
Super Advisor

Re: Enumerate S/W State for a raw disk...

OK thanks. Let's assume that I don't know the HW path. How do I get the HW path from a commandline so I can use it in your example? I am trying to write a script with the only knowledge of what the raw disk name is and getting the S/W State to make a decision based on the value of S/W State then take action.

Thanks
Heironimus
Honored Contributor

Re: Enumerate S/W State for a raw disk...

Use lssf to get the HW path:

$ lssf /dev/rdsk/c11t6d0
sdisk card instance 11 SCSI target 6 SCSI LUN 0 section 0 at address 0/0/0/2/0.6.0 /dev/rdsk/c11t6d0

In a script you could use something like this to pull the HW path out of the lssf output:

lssf /dev/rdsk/c11t6d0 | sed -e 's/.* at address \([^ ]\{1,\}\) .*$/\1/'
Gene Laoyan
Super Advisor

Re: Enumerate S/W State for a raw disk...

Thanks for your help. My segment of the script works great now.

Thanks!