<?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: Unexplained I/O error from dd in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033023#M431272</link>
    <description>By convention, UNIX programs return 0 on success and non-zero on failure. What that non-zero value means is entirely the whim of the programmer although again, by convention, the exit status is set to the value of errno of the failing system call OR the signal number that triggered the termination. Errno 2 = ENOENT (No such file or directory) so this is clearly not your problem. The real key is "I/O Error" which is almost certainly the stderr output of the perror() function and corresponds to errno 5 (EIO). This means some form of I/O error (End of Media, Bad Media, Failing Hardware, ...) was detected and that is all the OS knows. Had I written dd, if errno = 5 then I would have exited with status 5 but ...&lt;BR /&gt;&lt;BR /&gt;Man errno and examine /usr/include/sys/errno.h for more details.&lt;BR /&gt;&lt;BR /&gt;As to how you can create an 800KiB file (meaning 800 * 2^10 Bytes) then:&lt;BR /&gt;&lt;BR /&gt;dd if=/dev/urandom ibs=256 obs=1k of=myfile.dat count=3200&lt;BR /&gt;&lt;BR /&gt;This will create an 800KiB file of random data (but it does assume you are running on 11.11 and up). You really want random data when testing tape drives to better challenge the compression. You should also note that trying to determine the capacity of a tape drive with compression is difficult/pointless/questionable because the capacity is entirely data dependent. For example, suppose your input file were all NUL's (e.g. using /dev/zero as your imput file). How much would a stream of all zeroes compress? The only value that you should trust is the Native capacity; you will always be able to get that much and for that number all you have to do is read the box the tape came in.</description>
    <pubDate>Fri, 09 Mar 2007 14:02:05 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2007-03-09T14:02:05Z</dc:date>
    <item>
      <title>Unexplained I/O error from dd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033020#M431269</link>
      <description>Hello all,&lt;BR /&gt;I'm trying to find out how much space is left on a VS80 tape after performing a full database export.&lt;BR /&gt;&lt;BR /&gt;My routine looks like the following but does not work because dd returns $?=2&lt;BR /&gt;&lt;BR /&gt;writes=0&lt;BR /&gt;mt -t /dev/rmt/2mnb rew&lt;BR /&gt;mt -t /dev/rmt/2mnb eod&lt;BR /&gt;while `dd if=&amp;lt;800Kfile&amp;gt; of=/dev/rmt/2mnb bs=8192`&lt;BR /&gt;do&lt;BR /&gt;   let writes=$writes+1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Where can I find out what the error actually is?&lt;BR /&gt;Is there a better writer than dd for this kind of work?&lt;BR /&gt;&lt;BR /&gt;I tested the dd statement outside of the loop and it returns:&lt;BR /&gt;I/O Error&lt;BR /&gt;102+1 records in&lt;BR /&gt;102+1 records out&lt;BR /&gt;The operation appears to work because it takes a fair amount of time for the prompt to return.&lt;BR /&gt;&lt;BR /&gt;Was the operation in fact successful?&lt;BR /&gt;If so, how can I rewrite that loop (ie how do you detect end of tape)?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;RayB</description>
      <pubDate>Fri, 09 Mar 2007 10:49:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033020#M431269</guid>
      <dc:creator>Raynald Boucher</dc:creator>
      <dc:date>2007-03-09T10:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Unexplained I/O error from dd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033021#M431270</link>
      <description>I would rewrite it to something close to this so that the exit status is captured:&lt;BR /&gt;&lt;BR /&gt;typeset -i writes=0&lt;BR /&gt;typeset -i STAT=0&lt;BR /&gt;while [[ ${STAT} -eq 0 ]]&lt;BR /&gt;  do&lt;BR /&gt;    dd if=&amp;lt;800Kfile&amp;gt; of=/dev/rmt/2mnb bs=8k&lt;BR /&gt;    STAT=${?}&lt;BR /&gt;    if [[ ${STAT} -eq 0 ]]&lt;BR /&gt;      then&lt;BR /&gt;        ((writes += 1))&lt;BR /&gt;      fi&lt;BR /&gt;  done&lt;BR /&gt;echo "Status = ${STAT}"&lt;BR /&gt;&lt;BR /&gt;You should also make sure that your 800Kfile is, in fact, an 800KiB file so that you always get 100+0 records in. This will ensure that all the input blocks are fully read each time.</description>
      <pubDate>Fri, 09 Mar 2007 11:20:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033021#M431270</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-03-09T11:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Unexplained I/O error from dd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033022#M431271</link>
      <description>Hello Clay,&lt;BR /&gt;I modified your script slightly and got the following:&lt;BR /&gt;&lt;BR /&gt;# cat testdd&lt;BR /&gt;typeset -i writes=0&lt;BR /&gt;typeset -i STAT=0&lt;BR /&gt;mt -t /dev/rmt/2mnb rew&lt;BR /&gt;mt -t /dev/rmt/2mnb eod&lt;BR /&gt;while [[ ${STAT} -eq 0 ]]&lt;BR /&gt;do&lt;BR /&gt;dd if=/usr/local/etc/basedata.dmp.test.Z of=/dev/rmt/2mnb bs=8k&lt;BR /&gt;STAT=${?}&lt;BR /&gt;if [[ ${STAT} -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;((writes += 1))&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;echo "Status = ${STAT}"&lt;BR /&gt;echo $writes&lt;BR /&gt;&lt;BR /&gt;# ./testdd&lt;BR /&gt;I/O error&lt;BR /&gt;102+1 records in&lt;BR /&gt;102+1 records out&lt;BR /&gt;Status = 2&lt;BR /&gt;0&lt;BR /&gt;&lt;BR /&gt;I'd like to know what status 2 means.&lt;BR /&gt;&lt;BR /&gt;How can I create a file that has a size of exactly 800K?   &lt;BR /&gt;&lt;BR /&gt;I tried a few options and it seems "conv=noerror,block,sync" works but I'm not sure exactly why.&lt;BR /&gt;Must be something to do with those darbed VS80 drives.&lt;BR /&gt;&lt;BR /&gt;# dd if=testfile.Z of=/dev/rmt/2mnb bs=8k conv=noerror,block,sync                      &lt;BR /&gt;102+1 records in&lt;BR /&gt;103+0 records out&lt;BR /&gt;# dd if=testfile.Z of=/dev/rmt/2mnb bs=8k conv=noerror                                 &lt;BR /&gt;I/O error&lt;BR /&gt;102+1 records in&lt;BR /&gt;102+1 records out&lt;BR /&gt;# dd if=tesfile.Z of=/dev/rmt/2mnb bs=8k conv=noerror,block                           &lt;BR /&gt;I/O error&lt;BR /&gt;102+1 records in&lt;BR /&gt;102+1 records out&lt;BR /&gt;# echo $?&lt;BR /&gt;2&lt;BR /&gt;# dd if=testfile.Z of=/dev/rmt/2mnb bs=8k conv=noerror,block,sync                      102+1 records in&lt;BR /&gt;103+0 records out&lt;BR /&gt;# echo $?&lt;BR /&gt;0&lt;BR /&gt;# dd if=testfile.Z of=/dev/rmt/2mnb bs=8k conv=noerror,block,sync                      102+1 records in&lt;BR /&gt;103+0 records out&lt;BR /&gt;# echo $?&lt;BR /&gt;0&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;Do you have any other ideas on why this is occurring?&lt;BR /&gt;&lt;BR /&gt;RayB</description>
      <pubDate>Fri, 09 Mar 2007 13:26:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033022#M431271</guid>
      <dc:creator>Raynald Boucher</dc:creator>
      <dc:date>2007-03-09T13:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Unexplained I/O error from dd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033023#M431272</link>
      <description>By convention, UNIX programs return 0 on success and non-zero on failure. What that non-zero value means is entirely the whim of the programmer although again, by convention, the exit status is set to the value of errno of the failing system call OR the signal number that triggered the termination. Errno 2 = ENOENT (No such file or directory) so this is clearly not your problem. The real key is "I/O Error" which is almost certainly the stderr output of the perror() function and corresponds to errno 5 (EIO). This means some form of I/O error (End of Media, Bad Media, Failing Hardware, ...) was detected and that is all the OS knows. Had I written dd, if errno = 5 then I would have exited with status 5 but ...&lt;BR /&gt;&lt;BR /&gt;Man errno and examine /usr/include/sys/errno.h for more details.&lt;BR /&gt;&lt;BR /&gt;As to how you can create an 800KiB file (meaning 800 * 2^10 Bytes) then:&lt;BR /&gt;&lt;BR /&gt;dd if=/dev/urandom ibs=256 obs=1k of=myfile.dat count=3200&lt;BR /&gt;&lt;BR /&gt;This will create an 800KiB file of random data (but it does assume you are running on 11.11 and up). You really want random data when testing tape drives to better challenge the compression. You should also note that trying to determine the capacity of a tape drive with compression is difficult/pointless/questionable because the capacity is entirely data dependent. For example, suppose your input file were all NUL's (e.g. using /dev/zero as your imput file). How much would a stream of all zeroes compress? The only value that you should trust is the Native capacity; you will always be able to get that much and for that number all you have to do is read the box the tape came in.</description>
      <pubDate>Fri, 09 Mar 2007 14:02:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033023#M431272</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-03-09T14:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Unexplained I/O error from dd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033024#M431273</link>
      <description>Good explanation,&lt;BR /&gt;&lt;BR /&gt;Thanks for the references and the file creation tip.  &lt;BR /&gt;I had been using a compressed export file from oracle.&lt;BR /&gt;&lt;BR /&gt;I'll see what else I can do next week (assuming all those DST changes work...)&lt;BR /&gt;&lt;BR /&gt;Take care&lt;BR /&gt;&lt;BR /&gt;RayB</description>
      <pubDate>Fri, 09 Mar 2007 14:28:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033024#M431273</guid>
      <dc:creator>Raynald Boucher</dc:creator>
      <dc:date>2007-03-09T14:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Unexplained I/O error from dd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033025#M431274</link>
      <description>Definition of dd: Send and pray&lt;BR /&gt; &lt;BR /&gt;Seriously, dd is far too stupid to know anything about a tape drive and will never return a useful status. Your error code is almost always errno 5 meaning I/O error. So out of the dozens of potential problems with the drive or the tape, you get one status: I/O error.&lt;BR /&gt; &lt;BR /&gt;You cannot detect end-of-tape when you use dd. There is no choice but to write a real program that talks to the driver and tests every action for success and requests (and decodes) full status for any errors. That way, you can detect the end of tape and do the correct thing (whatever that is). If this is an experiment in your free time, you can play around with cleaning tapes, different brands and possibly different tape drives until it seems to work. I would never use dd for any production process. dd is just too dumb to be used for this type of application.</description>
      <pubDate>Fri, 09 Mar 2007 20:33:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033025#M431274</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2007-03-09T20:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Unexplained I/O error from dd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033026#M431275</link>
      <description>Gents,&lt;BR /&gt;I found a solution / workaround!&lt;BR /&gt;&lt;BR /&gt;Instead of using a dmp file as input I created a OneMegFile using&lt;BR /&gt;&lt;BR /&gt;dd if=&lt;SOMEFILE&gt; ibs=256 obs=8k of=OneMegFile count=4000&lt;BR /&gt;&lt;BR /&gt;This then allows the original without errors&lt;BR /&gt;&lt;BR /&gt;dd if=OneMegFile of=/dev/rmt/2mnb bs=8k&lt;BR /&gt;&lt;BR /&gt;Hope it's usefull to you,&lt;BR /&gt;Take care&lt;BR /&gt;RayB&lt;/SOMEFILE&gt;</description>
      <pubDate>Tue, 13 Mar 2007 11:22:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033026#M431275</guid>
      <dc:creator>Raynald Boucher</dc:creator>
      <dc:date>2007-03-13T11:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Unexplained I/O error from dd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033027#M431276</link>
      <description>I think left...&lt;BR /&gt;I don't have /dev/urandom on my system...&lt;BR /&gt;something else to look for!</description>
      <pubDate>Tue, 13 Mar 2007 11:30:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unexplained-i-o-error-from-dd/m-p/5033027#M431276</guid>
      <dc:creator>Raynald Boucher</dc:creator>
      <dc:date>2007-03-13T11:30:15Z</dc:date>
    </item>
  </channel>
</rss>

