<?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: How can I obtain a disk address programmatically (c) knowing only a device file? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944274#M412345</link>
    <description>I have found, what I think, is a solution. As I mentioned before, I scan the pstat pst_diskinfo tables. The problem was that not all device files were included (probably because they weren't used in a while...just a guess). Anyway, I discovered that if I open the device file BEFORE I scan the pst_diskinfo table, then the device file is added. &lt;BR /&gt;&lt;BR /&gt;Thanks to all who answered. Points have been assigned to all who answered in recognition of your effort.&lt;BR /&gt;&lt;BR /&gt;Bill, I wasn't being obnoxious with my last reply. I come from a mainframe world where everything in the system is available to authorized users. The control blocks (structures) are not always documented, but, having access to the code solves that problem. It's a little difficult adjusting, even after 10 years, to a world where the sys admin is supposed to just "trust" the OS.&lt;BR /&gt;&lt;BR /&gt;Take care and thanks again! &lt;BR /&gt;&lt;BR /&gt;Wayne</description>
    <pubDate>Tue, 06 Dec 2005 11:33:56 GMT</pubDate>
    <dc:creator>Wayne R. Clesi</dc:creator>
    <dc:date>2005-12-06T11:33:56Z</dc:date>
    <item>
      <title>How can I obtain a disk address programmatically (c) knowing only a device file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944267#M412338</link>
      <description>I have a need to get a disk (or tape or whatever) address knowing only the device file. Currently, I do the brute force (version 2.0) method. I scan each entry in the pstat structure pst_diskinfo table building the "device file" from the information contained in it. If that matches the device file name that I have, then I can get the address.  &lt;BR /&gt;&lt;BR /&gt;Problem is alternate links (NIKEs, VA7400's, etc.) are not in the pst_diskinfo table. Since I know the card instance number, etc. from the device file, is there a way to build the address by looking at kernel tables (other then the pst_diskinfo)? &lt;BR /&gt;&lt;BR /&gt;I'm running HPUX 11.0 (don't laugh...).&lt;BR /&gt;&lt;BR /&gt;Any suggestions would be appreciated! &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Wayne</description>
      <pubDate>Fri, 02 Dec 2005 15:29:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944267#M412338</guid>
      <dc:creator>Wayne R. Clesi</dc:creator>
      <dc:date>2005-12-02T15:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I obtain a disk address programmatically (c) knowing only a device file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944268#M412339</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try to look on &lt;BR /&gt;ioscan -kfnCdisk &lt;BR /&gt;output. You can find the requested information there.&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Fri, 02 Dec 2005 15:34:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944268#M412339</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2005-12-02T15:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can I obtain a disk address programmatically (c) knowing only a device file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944269#M412340</link>
      <description>Thanks for the reply, but I was trying to avoid parsing the output from a command.&lt;BR /&gt;&lt;BR /&gt;I was looking for insight as to what C code could be written to scan the tables, etc. &lt;BR /&gt;&lt;BR /&gt;Wayne</description>
      <pubDate>Fri, 02 Dec 2005 15:37:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944269#M412340</guid>
      <dc:creator>Wayne R. Clesi</dc:creator>
      <dc:date>2005-12-02T15:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I obtain a disk address programmatically (c) knowing only a device file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944270#M412341</link>
      <description>Well, here's the reverse way:&lt;BR /&gt;&lt;BR /&gt;How to decode those device numbers         &lt;BR /&gt;&lt;BR /&gt;e.g 0x1f0d0700&lt;BR /&gt;&lt;BR /&gt;The first 2 hex digits (1fhex - 31decimal) indicate the major device number. Do an lsdev and look for "31". You will find that major block device 31 is SCSI disk. Thus this is a /dev/dsk device node.&lt;BR /&gt;&lt;BR /&gt;The next 2 hex digits (0dhex - 13 decimal) indicate the bus "instance" number or controller number; "c13" in this case.&lt;BR /&gt;&lt;BR /&gt;The next hex digit (0) indicates the SCSI ID or target. "t0" in this case.&lt;BR /&gt;&lt;BR /&gt;The next hex digit (7) indicates the LUN (d7) in this case.&lt;BR /&gt;&lt;BR /&gt;The remaining 2 hex digits are device driver specific.&lt;BR /&gt;&lt;BR /&gt;In summary, 0x1f0d0700 decodes to&lt;BR /&gt;/dev/dsk/c13t0d7. &lt;BR /&gt;&lt;BR /&gt;Don't know if that will help or not...&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Dec 2005 15:43:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944270#M412341</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-12-02T15:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I obtain a disk address programmatically (c) knowing only a device file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944271#M412342</link>
      <description>Yes, I actually knew that. In fact, I have a PERL script that breaks that down for me (I use it when I get LVM error messages). &lt;BR /&gt;&lt;BR /&gt;Thanks for the reply!&lt;BR /&gt;&lt;BR /&gt;Wayne</description>
      <pubDate>Fri, 02 Dec 2005 16:08:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944271#M412342</guid>
      <dc:creator>Wayne R. Clesi</dc:creator>
      <dc:date>2005-12-02T16:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I obtain a disk address programmatically (c) knowing only a device file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944272#M412343</link>
      <description>If you need the actual hardware path (such as 8/0.2.1), you'll need to use the lssf command. The reason is that an instance is mapped to a physical address when the device file is created and only the kernel knows the physical mapping.</description>
      <pubDate>Fri, 02 Dec 2005 19:21:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944272#M412343</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-12-02T19:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I obtain a disk address programmatically (c) knowing only a device file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944273#M412344</link>
      <description>...and there is no way to get to those kernel structures? &lt;BR /&gt;&lt;BR /&gt;Wayne</description>
      <pubDate>Mon, 05 Dec 2005 12:09:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944273#M412344</guid>
      <dc:creator>Wayne R. Clesi</dc:creator>
      <dc:date>2005-12-05T12:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I obtain a disk address programmatically (c) knowing only a device file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944274#M412345</link>
      <description>I have found, what I think, is a solution. As I mentioned before, I scan the pstat pst_diskinfo tables. The problem was that not all device files were included (probably because they weren't used in a while...just a guess). Anyway, I discovered that if I open the device file BEFORE I scan the pst_diskinfo table, then the device file is added. &lt;BR /&gt;&lt;BR /&gt;Thanks to all who answered. Points have been assigned to all who answered in recognition of your effort.&lt;BR /&gt;&lt;BR /&gt;Bill, I wasn't being obnoxious with my last reply. I come from a mainframe world where everything in the system is available to authorized users. The control blocks (structures) are not always documented, but, having access to the code solves that problem. It's a little difficult adjusting, even after 10 years, to a world where the sys admin is supposed to just "trust" the OS.&lt;BR /&gt;&lt;BR /&gt;Take care and thanks again! &lt;BR /&gt;&lt;BR /&gt;Wayne</description>
      <pubDate>Tue, 06 Dec 2005 11:33:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-obtain-a-disk-address-programmatically-c-knowing-only/m-p/4944274#M412345</guid>
      <dc:creator>Wayne R. Clesi</dc:creator>
      <dc:date>2005-12-06T11:33:56Z</dc:date>
    </item>
  </channel>
</rss>

