1823415 Members
2447 Online
109655 Solutions
New Discussion юеВ

device file information

 
SOLVED
Go to solution
SAM_24
Frequent Advisor

device file information

Hi Gurus,

Given hardware path I want to find out device file information using some commands or script.
For example HW=0/7/0/0.6.0 I want to find out /dev/dsk/cNtNdN info. I want to automate this in the script for some tasks. Help.


Thanks.
Never quit
5 REPLIES 5
RAC_1
Honored Contributor
Solution

Re: device file information

ioscan -fnH your_hardware_path
will give you details.

Regards,
There is no substitute to HARDWORK
Arockia Jegan
Trusted Contributor

Re: device file information

As Anil mentioned you can use that command to find out the device file name from HW path.

If you have device file name by using the following command you can get more info about the device file.

#lssf < device file>

eg:

#lssf /dev/rmt/0mn
A. Clay Stephenson
Acclaimed Contributor

Re: device file information

One point of clarification: The hardware path does not necessairily point to a known device node. The 'c' part refers to controller 'instance' number rather than a particular slot. The instance means the order is which the system 'discovered' this device.

Let's say that you have a machine with two SCSI controllers (c0 and c1). Now you add a new controller - c3. Next, you decide to reload the OS. You might actually find that what was c1 is now c2!. While the order the hardware is searched is fixed, there is no definite mapping of a hardware path to a logical path.

If it ain't broke, I can fix that.
Holger Knoppik
Valued Contributor

Re: device file information

Hi Raj,

maybe this is what you need:

---begin script---
#!/bin/sh
#
#set -x

PATH=/usr/bin:/bin:/usr/sbin:/sbin
OUTFILE=/var/conf/stminfo.disk

if [ -f ${OUTFILE} ]
then
echo "NOTE: overwriting existing file ${OUTFILE}"
else
echo "Creating ${OUTFILE}"
fi

cstm </dev/null 2>&1
scl type disk
info
wait
infolog
saveas
${OUTFILE}
done
quit
ok
!
echo "Disk HW-Path, device files and Serial No."
echo "--------------------------------------------------------"
grep -e ^Hardware -e ^Serial ${OUTFILE} | awk '{print $3}' | while read VALUE ; do
echo $VALUE | grep -q '[0-9]/'
if [ $? -eq 0 ] ; then
HWPATH=$VALUE
ioscan -fnH${VALUE} | sed -n 's+.*\(/dev/dsk/[^ ]*\).*+\1+p' | read DEVICE
else
printf "%20s %15s %15s\n" $HWPATH $DEVICE $VALUE
fi
done
echo "NOTE: STM disk information has been saved to ${OUTFILE}."
echo "--------------------------------------------------------"

---end script---

Ensure that you have installed the online diagnostics bundle. This script puts out a table with the HW-Path, dsk devicefiles and serial number.
It should regard Clay's statement that devicefiles are not static.
BTW: Clay, i hope i understood your post.

HTH
RGDS, Holger
Live long and prosper!
Rahul Mehta
Valued Contributor

Re: device file information

If he doesnot have stm this script will not work