1843995 Members
2191 Online
110226 Solutions
New Discussion

hw-path to dev-file

 
SOLVED
Go to solution
fuchs_1
New Member

hw-path to dev-file

hi!

i need a way how to find out the dev-file if the hw-path is known (i??m shure it??s a easy task, but i dont know).

example: i have a tape on the path: 0/2/0/0.4.2.255.0.0.1

which belongs to the /dev/rmt/25m. an ll to the dev-file brings the following result:
crw-rw-rw- 2 bin bin 205 0x420100 Dec 12 07:57 /dev/rmt/25m

for a short script i need (if it exists) a way, how to find with the info of the hw-path the dev-file.

who knows a short solution?
9 REPLIES 9
Robert-Jan Goossens
Honored Contributor

Re: hw-path to dev-file

Hi,

Think you can you use
# ioscan -fnc tape
the output will show both the hardware and the file path.

Hope it helps,

Robert-Jan.
Robert-Jan Goossens
Honored Contributor

Re: hw-path to dev-file

Sorry made a typo
# ioscan -fnC tape
fuchs_1
New Member

Re: hw-path to dev-file

ok , thats the i find the informations that i write to the posting. BUT: i need the informations in a script and i hoped that there is a solution in the way of:

COMMAND hw-path

and the solution is:

/dev/rmt/5mn.

but it seems that i have to write a more intelligent script. thx
Robin Wakefield
Honored Contributor

Re: hw-path to dev-file

Hi,

ioscan -fnH0/2/0/0.4.2.255.0.0.1

will show you the device files associated with that h/w path.

Rgds, Robin.
Dietmar Konermann
Honored Contributor

Re: hw-path to dev-file

Examples:

# ioscan -fnkH 0/2/0/0.4.2.255.0.0.1

# lssf /dev/rmt/* | fgrep 0/2/0/0.4.2.255.0.0.1

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Ravi_8
Honored Contributor

Re: hw-path to dev-file

Hi,

'ioscan' is the tool that hepls you.
never give up
Robin Wakefield
Honored Contributor

Re: hw-path to dev-file

Hi,

If you want to script it, something like this:

===============================
#!/usr/bin/ksh

hw=$1
ioscan -fnH$hw | tail +4 | awk '{for (i=1;i<=NF;i++){print $i}}'
===============================

# ./hw_to_dev.sh 56/52.4.0
/dev/diag/rmt/c2t4d0
/dev/rmt/1mb
/dev/rmt/1mnb
/dev/rmt/c2t4d0BESTb
/dev/rmt/c2t4d0BESTnb
/dev/rmt/1m
/dev/rmt/1mn
/dev/rmt/c2t4d0BEST
/dev/rmt/c2t4d0BESTn

Rgds, Robin
Jean-Louis Phelix
Honored Contributor
Solution

Re: hw-path to dev-file

hi,

- To get the special file from the HW path, use :

# ioscan -kfnH path

- To get the HW path from the special file use :

# lssf special_file

Regards.
It works for me (© Bill McNAMARA ...)
Eugeny Brychkov
Honored Contributor

Re: hw-path to dev-file

This is fibre channel device connected to switch with domain #4, port #2 (I guess switch 8b or 16b), working in Target addressing mode, having LUN 1.
Please post ioscan here.
Usually /dev/rmt/Xm where X means tape drive number, and all other information is coded into minor of device file
Eugeny