- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HW path to special device file mapping
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 11:57 PM
07-10-2002 11:57 PM
HW path to special device file mapping
I have to check for every disk of our various storage subsystems (which sum up to a few hundred disks) the timeout value of the physical volume, and if necessary set it to 60 secs for Comparex disks and 120 secs for EMC disks (manufacturer recommendations).
Since there are so many disks to check and possibly to adjust I would like to do this by script.
Thus I'm now looking for a way to translate/map the HW path to the special device file's name because the pvdisplay and pvchange commands only take device file names.
The mapping from device to HW path is quite easy because you only have to issue something like:
# lssf $(strings /etc/lvmtab|grep dsk)|awk '{print $NF, $(NF-1)}'
But I need exactly the inverse mapping.
I know I could parse the dump from ioscan (please, have a look at the attachment for a sample Perl scriplet I wrote), but I find this a bit much ado.
Especially because the output of the device files from the ioscan command when you use the -n flag is nasty, because it goes on an extra line, and you have to catch situations where there isn't an extra line at all (as I had done in the sample Perl script).
I'm sure there must be a single HP-UX command like lssf that does the reverse mapping without the need to parse ioscan dumps, which I only haven't come accross yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 01:05 AM
07-11-2002 01:05 AM
Re: HW path to special device file mapping
I could be missing the point here ... but what about :
# ioscan -kfnC disk|awk {'A=$1;B=$3;C=$7;D=$8;getline;E=$1;F=$2;print A,B,C,D,E,F}'
Class H/W State H/W =====================================================================
disk 8/4.5.0 HP C5447A /dev/dsk/c0t5d0 /dev/rdsk/c0t5d0
disk 8/4.5.1 HP C5447A /dev/dsk/c0t5d1 /dev/rdsk/c0t5d1
disk 8/4.5.2 HP C5447A /dev/dsk/c0t5d2 /dev/rdsk/c0t5d2
disk 8/4.5.3 HP C5447A /dev/dsk/c0t5d3 /dev/rdsk/c0t5d3
disk 8/4.5.4 HP C5447A /dev/dsk/c0t5d4 /dev/rdsk/c0t5d4
disk 8/4.5.5 HP C5447A /dev/dsk/c0t5d5 /dev/rdsk/c0t5d5
disk 8/4.5.6 HP C5447A /dev/dsk/c0t5d6 /dev/rdsk/c0t5d6
disk 8/4.5.7 HP C5447A /dev/dsk/c0t5d7 /dev/rdsk/c0t5d7
disk 8/16/5.2.0 TOSHIBA CD-ROM /dev/dsk/c2t2d0 /dev/rdsk/c2t2d0
disk 8/16/5.4.0 SEAGATE ST34573W /dev/dsk/c2t4d0 /dev/rdsk/c2t4d0
disk 8/16/5.6.0 SEAGATE ST32272N /dev/dsk/c2t6d0 /dev/rdsk/c2t6d0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 01:07 AM
07-11-2002 01:07 AM
Re: HW path to special device file mapping
Oops, type in that ioscan ... even though it works :-). Should be :
ioscan -kfnC disk|awk '{A=$1;B=$3;C=$7;D=$8;getline;E=$1;F=$2;print A,B,C,D,E,F}'
Regards,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 01:25 AM
07-11-2002 01:25 AM
Re: HW path to special device file mapping
ioscan -fknH
eg. ioscan -fknH 10/0.6.0 | grep dsk
which returns;
/dev/dsk/c0t6d0 /dev/rdsk/c0td60
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 01:30 AM
07-11-2002 01:30 AM
Re: HW path to special device file mapping
thanks for your suggestion, but this also relies on parsing ioscan's output and glueing it together (nearly the same I achieve with my Perl snippet).
I had to look up the manpage of awk (prefer to use Perl ;-) to read what getline does.
As its name implies it only gets the next line from the file or piped command.
So your awk script would fail if the next output line from ioscan wasn't the related device file line.
This is what annoys me with ioscan's output of device files, because it is unreliable.
It'd be better if the developers of the ioscan program had supplied for an extra field in the ':' separated output of the -F flag.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 01:39 AM
07-11-2002 01:39 AM
Re: HW path to special device file mapping
The '-F' option produces listing of fields separated by colons (:). This is quite useful for parsing with 'awk'. Missing fields are separated by consecutive colon characters. See the 'ioscan' man pages for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 01:40 AM
07-11-2002 01:40 AM
Re: HW path to special device file mapping
I also already had in mind the -H flag but imho it's far too costly, because I would have to invoke the command a hundred times, as it doesn't seem to be able to cope with several -H arguments.
See, it only gives me one match:
# ioscan -k -H 1/10/0/0.8.0.255.0.5.3 -H 1/10/0/0.8.0.255.0.5.4
H/W Path Class Description
=======================================================================
1/10/0/0.8.0.255.0.5.4 disk HITACHI OPEN-8*3
Sorry HP-UX developers, but I think in this respect the ioscan programm sucks ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 01:45 AM
07-11-2002 01:45 AM
Re: HW path to special device file mapping
please, have a look a my attached little Perl ioscan parser.
I am using the -F flag already to make parsing easier.
I'm still convinced though, that the ioscan program has a few deficiencies.
HP-UX developers, how about a virtual /proc filesystem the way Linux offers it?
It's so easy to retrieve all your HW and process info from there
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 01:51 AM
07-11-2002 01:51 AM
Re: HW path to special device file mapping
I'm not giving up yet :-)
I had this same problem and solved it by using the script in the following thread
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x156c0b0717d1d5118ff40090279cd0f9,00.html
The 10 points answer by Robin should work for multiple (more than 1 line) devices.
Regards,
Tom
P.S. ... wow, James is early today ... Is it American time already :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 02:00 AM
07-11-2002 02:00 AM
Re: HW path to special device file mapping
thanks for pointing me to the other thread.
Nice solution of Robin, but I think Perl is better fit for this purpose, and to be honest I want to avoid the struggle of looking up awk's "awk"ward syntax, when I could do it much easier in Perl.
My objective was only to find out about a neat HP-UX command that does the reverse of lssf, and avoids any parsing of ioscan dumps (which was made unecessarily difficult by the developers, see my above remarks)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 02:01 AM
07-11-2002 02:01 AM
Re: HW path to special device file mapping
Oops, you are indeed already using '-F'. I've read that wrong twice. I guess Tom's right, its early and I need more coffee ;-)
/no points/
Regards!
...JRF...