<?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 to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959638#M27378</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for your quick reply. With your answer I am a little bit comfort but I feel it is good if you explain it with an example. Why because all the examles @ sg3 utils are talking about only sg path no example is taking sd path input. I will try with your options, I will let you know if I have any issues.&lt;BR /&gt;&lt;BR /&gt;-Masthan</description>
    <pubDate>Wed, 14 Mar 2007 02:09:22 GMT</pubDate>
    <dc:creator>Masthan</dc:creator>
    <dc:date>2007-03-14T02:09:22Z</dc:date>
    <item>
      <title>How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959632#M27372</link>
      <description>Hi All,&lt;BR /&gt; &lt;BR /&gt;Any one og you have any idea on scsi inquiry command ?&lt;BR /&gt; &lt;BR /&gt;I want to send an Inquiry command to a scsi device through sd path (.i.e. /dev/sda or /dev/sdb) by using SG_IO ioctl. Please explain me...&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;Your help is appreciated&lt;BR /&gt; &lt;BR /&gt;Regards&lt;BR /&gt;Masthan</description>
      <pubDate>Mon, 12 Mar 2007 01:20:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959632#M27372</guid>
      <dc:creator>Masthan</dc:creator>
      <dc:date>2007-03-12T01:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959633#M27373</link>
      <description>Hi Masthan,&lt;BR /&gt;&lt;BR /&gt;You can use the sg_inq command for your purpose.&lt;BR /&gt;This utility executes a SCSI INQUIRY command on the given device and interprets the results according to SPC-3 document. The term "standard INQUIRY" refers to a INQUIRY cdb that neither requests a Vital Product Data (VPD) page nor  Command Detail information (via the CmdDt bit). Here is the output from a standard INQUIRY. Actually the last entry ("Unit serial number") comes from the VPD page [0x80] of the same name if it is available. Older SCSI devices often put a serial number in a vendor specific area of a standard INQUIRY response (typically between bytes 36 and 55 inclusive).&lt;BR /&gt;$ sg_inq /dev/sda&lt;BR /&gt;&lt;BR /&gt;VPD pages are available from an INQUIRY, either in hex (e.g. with the option '-p=&lt;VPD_PAGE_HEX&gt;') or, in some cases, in decoded form. The importance of VPD pages is illustrated by two being made mandatory in latter versions of SPC-3: Supported VPD pages [0x0] and the Device Identification page [0x83]. Several VPD pages are now decoded. The "Supported VPD pages" page [0x0] is decoded when the '-e' option is given [without the '-p=&lt;VPD_PAGE_HEX&gt;' option] (sg3_utils &amp;gt;= v1.08). The Device Identification page [0x83] is decoded when the '-i' option is given (sg3_utils &amp;gt;= v1.07). The Extended INQUIRY page [0x86] is decoded when the '-x' option is given (sg3_utils &amp;gt;= v1.09). The SCSI Ports page [0x88] is decoded when the '-s' option is given (sg3_utils &amp;gt;= v1.11). The EMC (i.e. vendor) specific Unit Path Report page [0xc0] is decoded when the '-P' option is given (sg3_utils &amp;gt;= v1.09). Here is an example of the output from requesting the "Supported VPD pages" page:&lt;BR /&gt;$ sg_inq -e /dev/sg1&lt;BR /&gt;&lt;BR /&gt;The '-c' and  '-cl' options permit supported SCSI commands to be listed by using the CmdDt bit in an INQUIRY request. However SPC-3 has obsoleted this feature and introduced the new REPORT SUPPORTED OPERATION CODES SCSI command (see the sg_opcodes utility introduced in sg3_utils version 1.07). Not many SCSI devices support the new command yet.&lt;BR /&gt;&lt;BR /&gt;In sg3_utils version 1.08 a '-d' switch has been added to decode version descriptors. A standard INQUIRY response optionally contains up to 8 of these. For example a SCSI disk might have 4 version descriptors: SAM-2, SPC-2, SBC and SPI-4. SAM-2 is general architectural compliance, SPC-2 for SCSI primary (i.e. common) commands supported, SBC for SCSI block command set and SPI-4 indicates Ultra 320 support. Here is an example of the version descriptors on a disk:&lt;BR /&gt;$ sg_inq -d /dev/sdb&lt;BR /&gt;&lt;BR /&gt;You can also use the scsi_inquiry command&lt;BR /&gt;This program demonstrates the use of the SCSI_IOCTL_SEND_COMMAND ioctl to send a SCSI INQUIRY command. That ioctl() is supported by the SCSI sub system mid level and so is common to all sd, sr, st (osst) and sg devices. In sg3_utils this utility has been moved to the archive directory&lt;/VPD_PAGE_HEX&gt;&lt;/VPD_PAGE_HEX&gt;</description>
      <pubDate>Mon, 12 Mar 2007 02:00:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959633#M27373</guid>
      <dc:creator>Sandeepk_1</dc:creator>
      <dc:date>2007-03-12T02:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959634#M27374</link>
      <description>Hi Sandeep,&lt;BR /&gt;&lt;BR /&gt;Thanks for quick and long reply.&lt;BR /&gt;But that is not what I am looking I want to implement use own scsi inquiry command (by using SG_IO ioclts through sd path).&lt;BR /&gt;What My application does is,&lt;BR /&gt;&lt;BR /&gt;1) opens the sd device &lt;BR /&gt;2) send scsi inquiry command ioctl(fd, SG_IO)&lt;BR /&gt;3) report scsi inquiry data&lt;BR /&gt;4) close(fd)&lt;BR /&gt;&lt;BR /&gt;I am blokcing at step2...&lt;BR /&gt;Can you explain me how to send SG_IO ioctl ?&lt;BR /&gt;&lt;BR /&gt;-Mashtan</description>
      <pubDate>Mon, 12 Mar 2007 02:07:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959634#M27374</guid>
      <dc:creator>Masthan</dc:creator>
      <dc:date>2007-03-12T02:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959635#M27375</link>
      <description>You must first create and populate a "struct sg_io_hdr".&lt;BR /&gt;&lt;BR /&gt;You must also create a SCSI command block for the Inquiry command and use the cmdp field of the struct sg_io_hdr to point to it. The cmd_len field should contain the length of the command block.&lt;BR /&gt;&lt;BR /&gt;You must also prepare some memory for the Inquiry response. The pointer to the memory area goes to the dxferp field of the struct sg_io_hdr, and the available length of that area goes to the dxfer_len field. The dxfer_direction field should be set to DXFER_FROM_DEV.&lt;BR /&gt;&lt;BR /&gt;The "interface_id" field of the sg_io_hdr must be set to 'S'. This is needed to guard against an obsolete form of this ioctl.&lt;BR /&gt;&lt;BR /&gt;See this for an example:&lt;BR /&gt;&lt;A href="http://sg.torque.net/sg/sg_io.html#mozTocId568229" target="_blank"&gt;http://sg.torque.net/sg/sg_io.html#mozTocId568229&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The Linux SCSI Generic HOWTO has detailed documentation about the different fields of the sg_io_hdr structure:&lt;BR /&gt;&lt;A href="http://www.tldp.org/HOWTO/SCSI-Generic-HOWTO/index.html" target="_blank"&gt;http://www.tldp.org/HOWTO/SCSI-Generic-HOWTO/index.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;By the way... did my previous reply to you help at all?&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1106770" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1106770&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If this answer does not help, please give us more detail on what is going wrong.</description>
      <pubDate>Mon, 12 Mar 2007 09:45:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959635#M27375</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2007-03-12T09:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959636#M27376</link>
      <description>There's a CAM-like implementation for linux, is that what you're looking for?&lt;BR /&gt;&lt;BR /&gt;Like, setting modepages and such stuff? If yes, I'll dig through my bookmarks :)</description>
      <pubDate>Tue, 13 Mar 2007 23:43:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959636#M27376</guid>
      <dc:creator>Florian Heigl (new acc)</dc:creator>
      <dc:date>2007-03-13T23:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959637#M27377</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for your quick reply. With your answer I am a little but comfort but I feel it is good if you explain it with an example. Why because all the examles @ sg3 utils are talking about only sg path no example is taking sd path input. I will try with your options, I will let you know if I have any issues.&lt;BR /&gt;&lt;BR /&gt;-Masthan</description>
      <pubDate>Wed, 14 Mar 2007 02:08:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959637#M27377</guid>
      <dc:creator>Masthan</dc:creator>
      <dc:date>2007-03-14T02:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959638#M27378</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for your quick reply. With your answer I am a little bit comfort but I feel it is good if you explain it with an example. Why because all the examles @ sg3 utils are talking about only sg path no example is taking sd path input. I will try with your options, I will let you know if I have any issues.&lt;BR /&gt;&lt;BR /&gt;-Masthan</description>
      <pubDate>Wed, 14 Mar 2007 02:09:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959638#M27378</guid>
      <dc:creator>Masthan</dc:creator>
      <dc:date>2007-03-14T02:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959639#M27379</link>
      <description>As far as I understand linux scsi, 'sg' means scsi generic, whereas 'sd' is a scsi disk; that means different drivers, and a disk driver doesn't really need to include an interface for lowlevel scsi commands; that's all stuffed into 'sg', so that should be ok.&lt;BR /&gt;&lt;BR /&gt;(or maybe I'm dead wrong)&lt;BR /&gt;&lt;BR /&gt;The thing in my bookmarks was "scu", the scsi command utility, which is a bit dated, but has nice features.&lt;BR /&gt;&lt;A href="http://home.comcast.net/~SCSIguy/SCSI_FAQ/RMiller_Tools/scu.html" target="_blank"&gt;http://home.comcast.net/~SCSIguy/SCSI_FAQ/RMiller_Tools/scu.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;florian</description>
      <pubDate>Wed, 14 Mar 2007 09:50:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959639#M27379</guid>
      <dc:creator>Florian Heigl (new acc)</dc:creator>
      <dc:date>2007-03-14T09:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959640#M27380</link>
      <description>Linux used to have "sg" as a separate interface, but hot-plugging devices made that interface awkward to use (no way to relate which generic device maps to which disk/tape/cdrom/whatever device). &lt;BR /&gt;&lt;BR /&gt;The problem was the most obvious with the CD/DVD recorders (especially USB/Firewire-connected ones): the users were confused by having one interface for reading the media normally and another for burning. As a result, the normal disk/tape/cdrom device nodes will now (in kernel series 2.6.x and above) accept the SG_IO ioctls too.&lt;BR /&gt;&lt;BR /&gt;If you don't have root privileges, the kernel will sanitize the SG_IO requests so that only the known-harmless requests are allowed. To upgrade the firmware of your disk, you'll still need to be root.</description>
      <pubDate>Wed, 14 Mar 2007 12:41:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959640#M27380</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2007-03-14T12:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959641#M27381</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;You people are deviating that actual question. What I am expecting and what to know from you is,&lt;BR /&gt;&lt;BR /&gt;For inquiry ioctl, how sg_io_hdr structure definition will vary/differ for sg devices and for sd devices.&lt;BR /&gt;&lt;BR /&gt;The following snippet talks about the inquiry ioctl for sg devices by using SG_IO and sg_io_hdr &lt;BR /&gt;&lt;BR /&gt; unsigned char sense_b[32];&lt;BR /&gt;    unsigned char turCmbBlk[] = {TUR_CMD, 0, 0, 0, 0, 0};&lt;BR /&gt;    struct sg_io_hdr io_hdr;&lt;BR /&gt;&lt;BR /&gt;    memset(&amp;amp;io_hdr, 0, sizeof(struct sg_io_hdr));&lt;BR /&gt;    io_hdr.interface_id = 'S';&lt;BR /&gt;    io_hdr.cmd_len = sizeof(turCmbBlk);&lt;BR /&gt;    io_hdr.mx_sb_len = sizeof(sense_b);&lt;BR /&gt;    io_hdr.dxfer_direction = SG_DXFER_NONE;&lt;BR /&gt;    io_hdr.cmdp = turCmbBlk;&lt;BR /&gt;    io_hdr.sbp = sense_b;&lt;BR /&gt;    io_hdr.timeout = DEF_TIMEOUT;&lt;BR /&gt;&lt;BR /&gt;    if (ioctl(fd, SG_IO, &amp;amp;io_hdr) &amp;lt; 0) {&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now I want to know how the above sg_io_hdr definiton will vary for sd devices ? Can you redefine the above structure so that it will work for sd devices ?</description>
      <pubDate>Thu, 15 Mar 2007 05:27:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959641#M27381</guid>
      <dc:creator>Masthan</dc:creator>
      <dc:date>2007-03-15T05:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959642#M27382</link>
      <description>My point was that you're not supposed to inquire sd, but sg.</description>
      <pubDate>Thu, 15 Mar 2007 10:52:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959642#M27382</guid>
      <dc:creator>Florian Heigl (new acc)</dc:creator>
      <dc:date>2007-03-15T10:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to send inquiry command to thorugh sd path (i.e. /dev/sda) by using SG_IO ioctl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959643#M27383</link>
      <description>Why Can't we inquriy through sd path, So many documents clealy saying that on 2.6 kernels SG_IO ioctls supports both sg and sd drivers but now you are saying that use only sg driver for inquiry. Why can't we use sd driver for inquiry ?</description>
      <pubDate>Fri, 16 Mar 2007 00:05:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-send-inquiry-command-to-thorugh-sd-path-i-e-dev-sda-by/m-p/3959643#M27383</guid>
      <dc:creator>Masthan</dc:creator>
      <dc:date>2007-03-16T00:05:20Z</dc:date>
    </item>
  </channel>
</rss>

