Operating System - HP-UX
1748058 Members
5288 Online
108758 Solutions
New Discussion юеВ

Re: How to identify disk hardware path from device file

 
SOLVED
Go to solution
dictum9
Super Advisor

How to identify disk hardware path from device file


This is rx4640 running 11.23
from the disk device file such as /dev/dsk/c3t0d0, I need to get the hardware path programmatically. Is there an ioscan option that will combine the two?


#: ioscan -funC disk
Class I H/W Path Driver S/W State H/W Type Description
============================================================================
disk 0 0/0/3/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-B
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 2 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 73.4GST373454LC
/dev/dsk/c2t1d0 /dev/dsk/c2t1d0s2 /dev/rdsk/c2t1d0 /dev/rdsk/c2t1d0s2
/dev/dsk/c2t1d0s1 /dev/dsk/c2t1d0s3 /dev/rdsk/c2t1d0s1 /dev/rdsk/c2t1d0s3
disk 1 0/1/1/1.0.0 sdisk CLAIMED DEVICE HP 73.4GMAU3073NC
/dev/dsk/c3t0d0 /dev/dsk/c3t0d0s2 /dev/rdsk/c3t0d0 /dev/rdsk/c3t0d0s2
/dev/dsk/c3t0d0s1 /dev/dsk/c3t0d0s3 /dev/rdsk/c3t0d0s1 /dev/rdsk/c3t0d0s3
disk 3 0/2/1/0.4.124.0.0.4.0 sdisk CLAIMED DEVICE HITACHI OPEN-V
/dev/dsk/c4t4d0 /dev/rdsk/c4t4d0
disk 4 0/3/1/0.3.124.0.0.4.0 sdisk CLAIMED DEVICE HITACHI OPEN-V
/dev/dsk/c6t4d0 /dev/rdsk/c6t4d0

12 REPLIES 12
sujit kumar singh
Honored Contributor
Solution

Re: How to identify disk hardware path from device file

hi

ioscan -fnCdisk
/dev/dsk/c4t4d0 -- c4 refers to teh Controller Instance number 4, t$-- SCSI target ID 4 and d0 - LUN ID 0.
and 0/2/1/0.4.124.0.0.4.0 is the hardware path of the disk.
The second column in ioscan -fnCdisk is the HW_path for the disk.

ioscan -fnC ext_bus

shows you the Interface Instances in which at Instcnace 4 you shall find the Controller to which the disk /dev/dsk/c3t0d0 is attached.
0/2/1/0 is the hardware path of the controller to which the Disk is connected, can be SCSI or FC interface.

The second column in the ioscan -fnCext_bus is the HW_Path of the Interface.
regards
sujit

uwoodyjk
Occasional Advisor

Re: How to identify disk hardware path from device file

you can run print_manifest and then view the "Disk Layout" section.

Disk layout

LVM disk Device file HW Addr size vol. grp
IBM DMVS09D /dev/dsk/c1t0d0 0/0/1/1.0.0 8683 /dev/vg01
IBM DMVS09D /dev/dsk/c2t0d0 0/0/2/0.0.0 8683 /dev/vg01
SEAGATE ST318404LC /dev/dsk/c1t2d0 0/0/1/1.2.0 17366 /dev/vg00
IBM DMVS18D /dev/dsk/c2t2d0 0/0/2/0.2.0 17366 /dev/vg00
SEAGATE ST39102LC /dev/dsk/c4t0d0 0/4/0/0.0.0 8683 /dev/vg02
SEAGATE ST39204LC /dev/dsk/c5t0d0 0/7/0/0.0.0 8683 /dev/vg02
IBM DMVS09D /dev/dsk/c4t1d0 0/4/0/0.1.0 8683 /dev/vg04
IBM DMVS09D /dev/dsk/c5t3d0 0/7/0/0.3.0 8683 /dev/vg04
SEAGATE ST39204LC /dev/dsk/c4t3d0 0/4/0/0.3.0 8683 /dev/vg03
SEAGATE ST39204LC /dev/dsk/c5t2d0 0/7/0/0.2.0 8683 /dev/vg03
HP 73.4GATLAS10K3_73_SCA /dev/dsk/c4t13d0 0/4/0/0.13.0 70007 /dev/vg05
HP 73.4GATLAS10K3_73_SCA /dev/dsk/c5t1d0 0/7/0/0.1.0 70007 /dev/vg05
non-LVM disk Device file HW Addr size swap
HP DVD-ROM 304 /dev/dsk/c3t2d0 0/0/2/1.2.0

uwoodyjk
Occasional Advisor

Re: How to identify disk hardware path from device file

The following command will give you the hardware path and the character device file from the ioscan output.

# ioscan -funC disk | tr -s '[:space:]'| cut -f 3 -d " "

H/W
======================================================================
0/0/1/1.0.0
/dev/rdsk/c1t0d0
0/0/1/1.2.0
/dev/rdsk/c1t2d0
0/0/2/0.0.0
/dev/rdsk/c2t0d0
0/0/2/0.2.0
/dev/rdsk/c2t2d0
0/0/2/1.2.0
/dev/rdsk/c3t2d0
0/4/0/0.0.0
/dev/rdsk/c4t0d0
0/4/0/0.1.0
/dev/rdsk/c4t1d0
0/4/0/0.3.0
/dev/rdsk/c4t3d0
0/4/0/0.13.0
/dev/rdsk/c4t13d0
0/7/0/0.0.0
/dev/rdsk/c5t0d0
0/7/0/0.1.0
/dev/rdsk/c5t1d0
0/7/0/0.2.0
/dev/rdsk/c5t2d0
0/7/0/0.3.0
/dev/rdsk/c5t3d0
dictum9
Super Advisor

Re: How to identify disk hardware path from device file

Here is what I am trying to do, I am scriting the procedure to mirror disks in Itanium.

The only user input is the PRIMARY_DISK and MIRROR_DISK. Such as c3t0d0 and c1t0d0. The rest I want the script to figure out.

The script needs to set booth path, via setboot -p

I need the script to find out the Hardware path, such as 0/1/1/0.1.0 from the /dev/dsk/c3t0d0.

VK2COT
Honored Contributor

Re: How to identify disk hardware path from device file

Hello,

Take a look at the script I wrote when
I was teaching HP-UX SNA I last year:

http://www.circlingcycle.com.au/Unix-sources/HP-UX-11x-LVM-mirroring.sh.txt

You can use it or modify if you wish.

Cheers,

VK2COT
VK2COT - Dusan Baljevic

Re: How to identify disk hardware path from device file

wow a lot of folks making something that is really simple very complex...

the "lssf" commadn will of course show you the HW path for a device so simnply do:

lssf /dev/dsk/c2t1d0

And to just get the HW path?

lssf /dev/dsk/c2t1d0 | awk '{ print $15 }'


HTH

Duncan

I am an HPE Employee
Accept or Kudo
dictum9
Super Advisor

Re: How to identify disk hardware path from device file


That was what I wanted, thank you.


lssf /dev/dsk/c2t1d0 | awk '{ print $15 }'
dictum9
Super Advisor

Re: How to identify disk hardware path from device file

Thanks for the script also.

dictum9
Super Advisor

Re: How to identify disk hardware path from device file

I just noticed that another place they show up is in

lvlnboot -v

But it does not guarantee that it will have the mirror disk in there.
lssf is the best way to go.