Operating System - HP-UX
1833871 Members
1805 Online
110063 Solutions
New Discussion

Convert HW path to device name

 
SOLVED
Go to solution

Convert HW path to device name

Good day,

Is there a fast way to convert a HW path from ioscan to the device name associated to be used within a script.

Example: 0/0/12/1/0/4/0.110.27.19.0.4.1 is /dev/dsk/c26t4d1

Actually I am looking for a simple HP-UX command that will return the /dev/dsk/c26t4d1 for 0/0/12/1/0/4/0.110.27.19.0.4.1 entered

Is that possible ?

Regards,
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Convert HW path to device name

ioscan -H 0/0/12/1/0/4/0.110.27.19.0.4.1 -fn

and a little Perl or awk should get you there.
If it ain't broke, I can fix that.
Torsten.
Acclaimed Contributor

Re: Convert HW path to device name

Not really.

The only part of the hw path reflected in the device file is

0.4.1

out of

0/0/12/1/0/4/0.110.27.19.0.4.1

The part "0.4.1" indicates a LUN# 31 and will result in a device file

cxt4d1

The "x" depends.

But you can run

"ioscan -fnH 0/0/12/1/0/4/0.110.27.19.0.4.1"

and awk/grep the device file from the result.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   

Re: Convert HW path to device name

tks all

$disks = system("ioscan -H $device -fn|grep dsk");

returns only the /dev/dsk and /dev/rdsk entry which is EXACLTY what I was looking or.

Retards,
Torsten.
Acclaimed Contributor

Re: Convert HW path to device name

Consider to assign some points, please read

http://forums1.itrc.hp.com/service/forums/helptips.do?#33

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Doug O'Leary
Honored Contributor

Re: Convert HW path to device name

Hey;

ioscan -funC disk -H ${hw} | tail -1 | awk '{print $NF}'

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html