<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HW path to special device file mapping in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761656#M72610</link>
    <description>Tom,&lt;BR /&gt;&lt;BR /&gt;thanks for pointing me to the other thread.&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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)&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 11 Jul 2002 09:00:53 GMT</pubDate>
    <dc:creator>Ralph Grothe</dc:creator>
    <dc:date>2002-07-11T09:00:53Z</dc:date>
    <item>
      <title>HW path to special device file mapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761647#M72601</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;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).&lt;BR /&gt;Since there are so many disks to check and possibly to adjust I would like to do this by script.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;The mapping from device to HW path is quite easy because you only have to issue something like:&lt;BR /&gt;&lt;BR /&gt;# lssf $(strings /etc/lvmtab|grep dsk)|awk '{print $NF, $(NF-1)}'&lt;BR /&gt;&lt;BR /&gt;But I need exactly the inverse mapping.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;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).&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Thu, 11 Jul 2002 06:57:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761647#M72601</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2002-07-11T06:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: HW path to special device file mapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761648#M72602</link>
      <description>Hi Ralph&lt;BR /&gt;I could be missing the point here ... but what about :&lt;BR /&gt;# ioscan -kfnC disk|awk {'A=$1;B=$3;C=$7;D=$8;getline;E=$1;F=$2;print A,B,C,D,E,F}'&lt;BR /&gt;Class H/W State H/W ===================================================================== &lt;BR /&gt;disk 8/4.5.0 HP C5447A /dev/dsk/c0t5d0 /dev/rdsk/c0t5d0&lt;BR /&gt;disk 8/4.5.1 HP C5447A /dev/dsk/c0t5d1 /dev/rdsk/c0t5d1&lt;BR /&gt;disk 8/4.5.2 HP C5447A /dev/dsk/c0t5d2 /dev/rdsk/c0t5d2&lt;BR /&gt;disk 8/4.5.3 HP C5447A /dev/dsk/c0t5d3 /dev/rdsk/c0t5d3&lt;BR /&gt;disk 8/4.5.4 HP C5447A /dev/dsk/c0t5d4 /dev/rdsk/c0t5d4&lt;BR /&gt;disk 8/4.5.5 HP C5447A /dev/dsk/c0t5d5 /dev/rdsk/c0t5d5&lt;BR /&gt;disk 8/4.5.6 HP C5447A /dev/dsk/c0t5d6 /dev/rdsk/c0t5d6&lt;BR /&gt;disk 8/4.5.7 HP C5447A /dev/dsk/c0t5d7 /dev/rdsk/c0t5d7&lt;BR /&gt;disk 8/16/5.2.0 TOSHIBA CD-ROM /dev/dsk/c2t2d0 /dev/rdsk/c2t2d0&lt;BR /&gt;disk 8/16/5.4.0 SEAGATE ST34573W /dev/dsk/c2t4d0 /dev/rdsk/c2t4d0&lt;BR /&gt;disk 8/16/5.6.0 SEAGATE ST32272N /dev/dsk/c2t6d0 /dev/rdsk/c2t6d0&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jul 2002 08:05:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761648#M72602</guid>
      <dc:creator>Tom Geudens</dc:creator>
      <dc:date>2002-07-11T08:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: HW path to special device file mapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761649#M72603</link>
      <description>Hi again,&lt;BR /&gt;Oops, type in that ioscan ... even though it works :-). Should be :&lt;BR /&gt;ioscan -kfnC disk|awk '{A=$1;B=$3;C=$7;D=$8;getline;E=$1;F=$2;print A,B,C,D,E,F}'&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Tom</description>
      <pubDate>Thu, 11 Jul 2002 08:07:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761649#M72603</guid>
      <dc:creator>Tom Geudens</dc:creator>
      <dc:date>2002-07-11T08:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: HW path to special device file mapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761650#M72604</link>
      <description>I think you want;&lt;BR /&gt;&lt;BR /&gt;ioscan -fknH &lt;HARDWARE path=""&gt; | grep dsk&lt;BR /&gt;&lt;BR /&gt;eg. ioscan -fknH 10/0.6.0 | grep dsk&lt;BR /&gt;which returns;&lt;BR /&gt;/dev/dsk/c0t6d0 /dev/rdsk/c0td60&lt;BR /&gt;&lt;/HARDWARE&gt;</description>
      <pubDate>Thu, 11 Jul 2002 08:25:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761650#M72604</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2002-07-11T08:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: HW path to special device file mapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761651#M72605</link>
      <description>Tom,&lt;BR /&gt;&lt;BR /&gt;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).&lt;BR /&gt;I had to look up the manpage of awk (prefer to use Perl ;-) to read what getline does.&lt;BR /&gt;As its name implies it only gets the next line from the file or piped command.&lt;BR /&gt;So your awk script would fail if the next output line from ioscan wasn't the related device file line.&lt;BR /&gt;This is what annoys me with ioscan's output of device files, because it is unreliable.&lt;BR /&gt;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.</description>
      <pubDate>Thu, 11 Jul 2002 08:30:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761651#M72605</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2002-07-11T08:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: HW path to special device file mapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761652#M72606</link>
      <description>Hi Ralph:&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 11 Jul 2002 08:39:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761652#M72606</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-07-11T08:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: HW path to special device file mapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761653#M72607</link>
      <description>Stefan,&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;See, it only gives me one match:&lt;BR /&gt;&lt;BR /&gt;# ioscan -k -H 1/10/0/0.8.0.255.0.5.3 -H 1/10/0/0.8.0.255.0.5.4&lt;BR /&gt;H/W Path                Class                               Description&lt;BR /&gt;=======================================================================&lt;BR /&gt;1/10/0/0.8.0.255.0.5.4                              disk    HITACHI OPEN-8*3&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sorry HP-UX developers, but I think in this respect the ioscan programm sucks ;-)</description>
      <pubDate>Thu, 11 Jul 2002 08:40:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761653#M72607</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2002-07-11T08:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: HW path to special device file mapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761654#M72608</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;please, have a look a my attached little Perl ioscan parser.&lt;BR /&gt;I am using the -F flag already to make parsing easier.&lt;BR /&gt;I'm still convinced though, that the ioscan program has a few deficiencies.&lt;BR /&gt;&lt;BR /&gt;HP-UX developers, how about a virtual /proc filesystem the way Linux offers it?&lt;BR /&gt;It's so easy to retrieve all your HW and process info from there</description>
      <pubDate>Thu, 11 Jul 2002 08:45:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761654#M72608</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2002-07-11T08:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: HW path to special device file mapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761655#M72609</link>
      <description>Hi Ralph,&lt;BR /&gt;I'm not giving up yet :-)&lt;BR /&gt;I had this same problem and solved it by using the script in the following thread&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x156c0b0717d1d5118ff40090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x156c0b0717d1d5118ff40090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The 10 points answer by Robin should work for multiple (more than 1 line) devices.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Tom&lt;BR /&gt;&lt;BR /&gt;P.S. ... wow, James is early today ... Is it American time already :-)</description>
      <pubDate>Thu, 11 Jul 2002 08:51:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761655#M72609</guid>
      <dc:creator>Tom Geudens</dc:creator>
      <dc:date>2002-07-11T08:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: HW path to special device file mapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761656#M72610</link>
      <description>Tom,&lt;BR /&gt;&lt;BR /&gt;thanks for pointing me to the other thread.&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jul 2002 09:00:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761656#M72610</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2002-07-11T09:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: HW path to special device file mapping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761657#M72611</link>
      <description>Hi (again) Ralph &amp;amp; Tom:&lt;BR /&gt;&lt;BR /&gt;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 ;-)&lt;BR /&gt;&lt;BR /&gt;/no points/&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 11 Jul 2002 09:01:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hw-path-to-special-device-file-mapping/m-p/2761657#M72611</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-07-11T09:01:25Z</dc:date>
    </item>
  </channel>
</rss>

