Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
cancel
Showing results for 
Search instead for 
Did you mean: 

device file

Kwhite_1
Advisor

device file

people I am on hp-ux 11.31 and using xp 12000 stprage. Is there a script or an easy way to link the devices from the xpinfo output to the ioscan controller devices without doing an

ioscan -m dsf /dev/rdisk/disk29
Persistent DSF Legacy DSF(s)
========================================
/dev/rdisk/disk29 /dev/rdsk/c11t0d7
/dev/rdsk/c8t0d7


As I have like a 400 devices under vxvm
14 REPLIES
Jeff Schussele
Honored Contributor

Re: device file

Well....there are numerous ways to display/extract device names, but the simple fact is that you'll have to construct a loop in your script to process them all.

I'd probably set up a sed command keyed on null lines i. e. when a blank line comes up it's a new record. Process from there....

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Kwhite_1
Advisor

Re: device file

Thanks Jeff do you have any script like that
Viktor Balogh
Honored Contributor

Re: device file

hi,

what information do you need exactly?
you could try 'xpinfo -d', or try this:

#!/usr/bin/ksh

xpinfo -i | awk '/rdsk/ {print $8"\t"$6"\t"$1}' | sed 's/\/dev\/rdsk\///' > xpinfo.tmp

ioscan -fnC disk > ioscan
paste -s -d"\t\n" ioscan.tmp > ioscan.tmp
rm ioscan

while read box lun dev;do grep "${dev}" ioscan.tmp ;done < xpinfo.tmp

rm xpinfo.tmp ioscan.tmp



# but it depends on the version of xpinfo, you could modify the first awk line


****
Unix operates with beer.
Viktor Balogh
Honored Contributor

Re: device file

a sample output for the above script:

rx76218@hpvwp01:/root # while read box lun dev;do printf "%-15s %-8s" ${box} ${lun};grep "${dev}" ioscan.tmp ;done < xpinfo>
00070044 00:ed disk 30 0/2/1/0/4/0.1.8.0.0.0.0 sdisk CLAIMED DEVICE HP OPEN-V-CM /dev/dsk/c20t0d0 /dev/rdsk/c20t0d0
00070044 01:1d disk 34 0/2/1/0/4/0.1.8.0.0.0.1 sdisk CLAIMED DEVICE HP OPEN-V*8 /dev/dsk/c20t0d1 /dev/rdsk/c20t0d1
00070044 02:1d disk 41 0/2/1/0/4/0.1.8.0.0.0.2 sdisk CLAIMED DEVICE HP OPEN-V*8 /dev/dsk/c20t0d2 /dev/rdsk/c20t0d2
00070044 03:1d disk 48 0/2/1/0/4/0.1.8.0.0.0.3 sdisk CLAIMED DEVICE HP OPEN-V*8 /dev/dsk/c20t0d3 /dev/rdsk/c20t0d3
00070044 04:83 disk 54 0/2/1/0/4/0.1.8.0.0.0.4 sdisk CLAIMED DEVICE HP OPEN-V*2 /dev/dsk/c20t0d4 /dev/rdsk/c20t0d4
00070044 07:42 disk 124 0/2/1/0/4/0.1.8.0.0.0.5 sdisk CLAIMED DEVICE HP OPEN-V*8 /dev/dsk/c20t0d5 /dev/rdsk/c20t0d5
00070044 02:21 disk 115 0/2/1/0/4/0.1.8.0.0.2.0 sdisk CLAIMED DEVICE HP OPEN-V*8 /dev/dsk/c20t2d0 /dev/rdsk/c20t2d0
00070044 03:21 disk 116 0/2/1/0/4/0.1.8.0.0.2.1 sdisk CLAIMED DEVICE HP OPEN-V*8 /dev/dsk/c20t2d1 /dev/rdsk/c20t2d1
00070044 04:21 disk 117 0/2/1/0/4/0.1.8.0.0.2.2 sdisk CLAIMED DEVICE HP OPEN-V*8 /dev/dsk/c20t2d2 /dev/rdsk/c20t2d2
00070044 04:1d disk 40 0/2/1/0/4/0.1.9.0.0.0.1 sdisk CLAIMED DEVICE HP OPEN-V*8 /dev/dsk/c22t0d1 /dev/rdsk/c22t0d1
rx76218@hpvwp01:/root #
****
Unix operates with beer.
Viktor Balogh
Honored Contributor

Re: device file

sorry, the last while loop should be:

while read box lun dev;do printf "%-15s %-8s" ${box} ${lun};grep "${dev}" ioscan.tmp ;done < xpinfo.tmp

#this will map the xpinfo lines to the ioscan ones, one line per disk
****
Unix operates with beer.
Kranti Mahmud
Honored Contributor

Re: device file

Hi Kwhite,

U can use

diff-used to compare text files

cmp-for comparing binary files

dircmp-used to compare two directories

cksum is much better than diff or cmp is the. It does a CRC checksum on the files. If they match, you are absolutely assured that the files are identical in content.
(Eg : if file1 and file2 are identical)

# cksum file1 file2
=> will return similar output in the 1st and 2nd field.

If by 'hidden' files, you mean do cp -pR * copy files that begin with '.' then no it does not but that is really determined by the arguments passed into the command from the shell.

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
Kwhite_1
Advisor

Re: device file

Victor,

That did not work , I am attaching my xpinfo and ioscan, if you can attach the script that would be great.

xpinfo -il

Device File ALPA Tgt Lun Port LDKC:CU:LDev Type Serial#
====================================================================================
/dev/rdisk/disk2 e8 00 00 CL3A 0:00:0f OPEN-V*3 00018086
/dev/rdisk/disk7 d6 00 01 CL4A 0:0b:04 OPEN-V 00018086
/dev/rdisk/disk8 d6 00 02 CL4A 0:0b:05 OPEN-V 00018086
gpillai@a00015-/home/pganesh/script}ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
==================================================================
disk 0 5/0/6/1/0/4/1.20.0.1.0.0.0 sdisk CLAIMED DEVICE HP OPEN-V*3
/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 5/0/6/1/0/4/1.20.0.1.0.0.1 sdisk CLAIMED DEVICE HP OPEN-V
/dev/dsk/c3t0d1 /dev/rdsk/c3t0d1
disk 4 5/0/6/1/0/4/1.20.0.1.0.0.2 sdisk CLAIMED DEVICE HP OPEN-V
/dev/dsk/c3t0d2 /dev/rdsk/c3t0d2
disk 1 5/0/13/1/0/4/1.10.0.0.0.0.0 sdisk CLAIMED DEVICE HP OPEN-V*3
/dev/dsk/c5t0d0 /dev/dsk/c5t0d0s2 /dev/rdsk/c5t0d0 /dev/rdsk/c5t0d0s2
/dev/dsk/c5t0d0s1 /dev/dsk/c5t0d0s3 /dev/rdsk/c5t0d0s1 /dev/rdsk/c5t0d0s3
disk 5 5/0/13/1/0/4/1.10.0.0.0.0.1 sdisk CLAIMED DEVICE HP OPEN-V
/dev/dsk/c5t0d1 /dev/rdsk/c5t0d1
disk 6 5/0/13/1/0/4/1.10.0.0.0.0.2 sdisk CLAIMED DEVICE HP OPEN-V
/dev/dsk/c5t0d2 /dev/rdsk/c5t0d2
Viktor Balogh
Honored Contributor

Re: device file

are you sure you have '/dev/rdisk' in your xpinfo output?
****
Unix operates with beer.
Viktor Balogh
Honored Contributor

Re: device file

oooh, sorry. you must be using 11i v3, and in your ioscan output there are legacy DSFs. There's a -N switch for ioscan to showing with the new DSFs.
****
Unix operates with beer.
Viktor Balogh
Honored Contributor

Re: device file

ok, you can try this:

#!/usr/bin/ksh

xpinfo -il | awk '/rdisk/ {print $8"\t"$6"\t\t"$1}' | sed 's/\/dev\/rdisk\///' > xpinfo.tmp
ioscan -fnNCdisk | grep -v -e "^Class" -e "=" | sed 's/^disk/#disk/' | xargs | tr "#" "\n" > ioscan.tmp

while read box lun dev;do grep "/dev/disk/${dev} " ioscan.tmp ;done < xpinfo.tmp

rm xpinfo.tmp ioscan.tmp




#altough it is not so easy for me because #currently I don't have access to a 11iv3...
#plz report back if it helped
****
Unix operates with beer.
Viktor Balogh
Honored Contributor

Re: device file

here it is again in the attachment, the previous one was screwed by formatting.
****
Unix operates with beer.
Viktor Balogh
Honored Contributor

Re: device file

finally here is the correct one, i hope this will help. anyway, how can i delete my previous unwanted posts here?
****
Unix operates with beer.
Dennis Handly
Acclaimed Contributor

Re: device file

>Viktor: how can i delete my previous unwanted posts here?

You can ask the moderators to delete your replies in a monthly thread like this one:
Your questions regarding ITRC Forums > general
March/April 2009 Issues Requiring Moderator Intervention:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1318758

Make sure you include your URL and which reply.
Kwhite_1
Advisor

Re: device file

Thanks for all the efforts victor. The script gives output some what like this but still does not show the legacy devices like c3t0d1.

00018086 0:0b:04 disk 7 64000/0xfa00/0x5 esdisk CLAIMED DEVICE HP OPEN-V /dev/disk/disk7 /dev/rdisk/disk7
00018086 0:0b:05 disk 8 64000/0xfa00/0x6 esdisk CLAIMED DEVICE HP OPEN-V /dev/disk/disk8 /dev/rdisk/disk8


ioscan -m dsf /dev/rdisk/disk7
Persistent DSF Legacy DSF(s)
========================================
/dev/rdisk/disk7 /dev/rdsk/c3t0d1
/dev/rdsk/c5t0d1