<?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: Tape error messages in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/tape-error-messages/m-p/2578259#M31483</link>
    <description>This is what i do at the moment. I was hoping someone had gathered these error messages for me, as they seem to be undocumented. &lt;BR /&gt;&lt;BR /&gt;Can anyone give some more assistance?</description>
    <pubDate>Wed, 12 Sep 2001 08:24:50 GMT</pubDate>
    <dc:creator>Merit Europe</dc:creator>
    <dc:date>2001-09-12T08:24:50Z</dc:date>
    <item>
      <title>Tape error messages</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tape-error-messages/m-p/2578257#M31481</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Let me try another question, the last one worked out well!&lt;BR /&gt;&lt;BR /&gt;Before we run our backup, we check for the presence of a tape in the drive using the following command:&lt;BR /&gt;mt -t $DLT_TAPE rew&lt;BR /&gt;&lt;BR /&gt;Now there are a couple of possible scenarios for the error output, does anyone have a script that catches these error messages ($?), and connects this to a human readable error message?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;&lt;BR /&gt;Robert</description>
      <pubDate>Wed, 12 Sep 2001 07:57:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tape-error-messages/m-p/2578257#M31481</guid>
      <dc:creator>Merit Europe</dc:creator>
      <dc:date>2001-09-12T07:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Tape error messages</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tape-error-messages/m-p/2578258#M31482</link>
      <description>I would do&lt;BR /&gt;&lt;BR /&gt;mt -t $DLT_TAPE rew 2&amp;gt;/tmp/errlog&lt;BR /&gt;&lt;BR /&gt;if [ `wc -l` -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;#Here you can check for various errors and echo&lt;BR /&gt;#human readable. Else if you just want to &lt;BR /&gt;#print the error&lt;BR /&gt;cat /tmp/errlog&lt;BR /&gt;rm /tmp/errlog&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Wed, 12 Sep 2001 08:02:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tape-error-messages/m-p/2578258#M31482</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-09-12T08:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Tape error messages</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tape-error-messages/m-p/2578259#M31483</link>
      <description>This is what i do at the moment. I was hoping someone had gathered these error messages for me, as they seem to be undocumented. &lt;BR /&gt;&lt;BR /&gt;Can anyone give some more assistance?</description>
      <pubDate>Wed, 12 Sep 2001 08:24:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tape-error-messages/m-p/2578259#M31483</guid>
      <dc:creator>Merit Europe</dc:creator>
      <dc:date>2001-09-12T08:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Tape error messages</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tape-error-messages/m-p/2578260#M31484</link>
      <description>&lt;BR /&gt;The only error codes you can really get from using the mt command are 0 (success) or 1 (failure).&lt;BR /&gt;&lt;BR /&gt;So;&lt;BR /&gt;&lt;BR /&gt;mt -t /dev/rmt/0m rew&lt;BR /&gt;if [ $? -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;  echo Either no tape in the drive or tape in use.&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;The only question is how to test the tape in the drive is writeable ? Doing a rewind will not detect a non-writeable tape. Perhaps you would want to do a write test to the tape also to check its writeable ? (use something like echo &amp;gt; /dev/rmt/0m )&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Sep 2001 08:28:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tape-error-messages/m-p/2578260#M31484</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2001-09-12T08:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Tape error messages</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tape-error-messages/m-p/2578261#M31485</link>
      <description>Robert,&lt;BR /&gt;&lt;BR /&gt;Try compiling the following.  Basically the "mt_gstat" field is defined in /usr/include/sys/mtio.h and defines the state (including write protect status) of the tape/drive.  You'll probably want to play with this to get what you want, but it's a start:&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin&lt;BR /&gt;&lt;BR /&gt;======================================&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;FCNTL.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;ERRNO.H&gt;&lt;BR /&gt;&lt;BR /&gt;int main(int argc,char *argv[])&lt;BR /&gt;{&lt;BR /&gt;/*      int argc;&lt;BR /&gt;        char *argv[]; */&lt;BR /&gt;        struct mtget mtget;&lt;BR /&gt;        struct mtop mtop;&lt;BR /&gt;        char *dev="/dev/rmt/3hcn";&lt;BR /&gt;        int fd;&lt;BR /&gt;        if (argc &amp;gt; 2)&lt;BR /&gt;        {&lt;BR /&gt;                fprintf(stderr, "Usage: %s &lt;DEVICE name=""&gt;\n", argv[0]);&lt;BR /&gt;                exit(1);&lt;BR /&gt;        }&lt;BR /&gt;        if (argc == 2)&lt;BR /&gt;                dev=argv[1];&lt;BR /&gt;/* open the device */&lt;BR /&gt;        if ((fd=open(dev,O_RDWR))&amp;lt;0)&lt;BR /&gt;        {&lt;BR /&gt;/*              printf("\nfd ERROR = %d\n",errno);      */&lt;BR /&gt;                perror("open failed");&lt;BR /&gt;                exit(errno);&lt;BR /&gt;        }&lt;BR /&gt;&lt;BR /&gt;        if ((ioctl(fd,MTIOCGET,&amp;amp;mtget))&amp;lt;0)&lt;BR /&gt;        {&lt;BR /&gt;                perror("ioctl(MTIOCGET) failed");&lt;BR /&gt;                exit(errno);&lt;BR /&gt;        }&lt;BR /&gt;        printf("\nmt_gstat = %x\n",mtget.mt_gstat);&lt;BR /&gt;/*      else&lt;BR /&gt;        {&lt;BR /&gt;                printf("\nmt_gstat = %x\n",mtget.mt_gstat);&lt;BR /&gt;                if (GMT_BOT(mtget.mt_gstat))&lt;BR /&gt;                        printf("BOT\n");&lt;BR /&gt;                else if (GMT_EOT(mtget.mt_gstat))&lt;BR /&gt;                        printf("EOT\n");&lt;BR /&gt;        } */&lt;BR /&gt;exit(0) ;&lt;BR /&gt;}&lt;BR /&gt;==========================================&lt;/DEVICE&gt;&lt;/ERRNO.H&gt;&lt;/STDIO.H&gt;&lt;/FCNTL.H&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/SYS&gt;</description>
      <pubDate>Wed, 12 Sep 2001 13:42:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tape-error-messages/m-p/2578261#M31485</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-09-12T13:42:13Z</dc:date>
    </item>
  </channel>
</rss>

