Operating System - HP-UX
1855754 Members
4633 Online
104103 Solutions
New Discussion

Re: Hardware path to device file

 
SOLVED
Go to solution
Stuart Powell
Super Advisor

Hardware path to device file

It's been a long time since I've done this. I have a CD ROM drive at SCSI address 10/12/5.2.0 and I don't remember how to convert that to the device file in /dev/dsk. I'm not only looking for the immediate answer, but also a good description so that I can avoid asking the same question in the future.
Sometimes the best answer is another question
10 REPLIES 10
Karvendhan M
Frequent Advisor

Re: Hardware path to device file

# man mksf


~Karvendhan M.
Wim Rombauts
Honored Contributor
Solution

Re: Hardware path to device file

If you use the command "ioscan -fn", you get a list with all devices, there hardware path and the device file(s) linked to it.
Steven Gillard_2
Honored Contributor

Re: Hardware path to device file

It is cxtydz where:

x: card instance number
y: SCSI target id
z: logical unit number (LUN)

So in your case its cxt2d0. I can't tell you what x is without ioscan output displaying the instance number.

Best way to find the device file is to use ioscan with the -n option:

# ioscan -kfnH

That will list device all device files belonging to that device.

Cheers,
Steve
Gerhard Goettinger
Occasional Contributor

Re: Hardware path to device file

try ioscan -fn then you get the path to the correct device file.
Enbin Hu
Advisor

Re: Hardware path to device file

Stuart:

Try the following command:
# insf -H 10/12/5.2.0

man insf will give you detailed explaination.

Hope it helps.

Enbin
Stuart Powell
Super Advisor

Re: Hardware path to device file

Thanks to all.
Sometimes the best answer is another question
Rainer von Bongartz
Honored Contributor

Re: Hardware path to device file


ioscan -fnC disk

will give you the relation between HW Path and device file for your disk (cdrom)

Ragards
Rainer
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
Robin Wakefield
Honored Contributor

Re: Hardware path to device file

Hi Stuart,

If you know the HW path, then ioscan will give you the answer:

ioscan -fnH10/12/5.2.0

Rgds, Robin
Eugen Cocalea
Respected Contributor

Re: Hardware path to device file

Hi,

steps:

1. man mksf. read it.

2. man lsdev. read it.

3. man ioscan. read it.

4. man mknod. read it.

now you're ready for:

1. do a ioscan -f. identify the CDROM drive. see what driver it has.

2. lsdev -d
you will get the major number from this command. (the number below Character / Block)

3. Now, you have to build a 6 digits hexa number (the minor) like this:

0xyz00

where:

x - number on the interface column from ioscan output (from the bus line) - your case is 'a' from the '10' in 10base :)

y - the scsi id - your case is '2'

z - the lun - your case is '0'.

last two 00's are reserved

that leads to your needed minor number 0x0a2000

4. now do a

mknod /dev/dsk/mycdrom b 0x0a2000

and

mknod /dev/rdsk/mycdrom c 0x0a2000

there you are (I think).

There might be mistakes in what I've said, people that know better can correct me.

Hope you will find above readable and it will solve your problem.

E.
To Live Is To Learn
Eugen Cocalea
Respected Contributor

Re: Hardware path to device file

Hi,

I'm laughing my a__ off. All you wanted was to make the 'mental' link between software and hardware? I understood something like: 'i don't know how to make it' not 'i don't know where it is'. Well, I had to re-read some docs with this occasion so I can say it helped me remember as well.

E.
To Live Is To Learn