Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 May 2011 16:38:57 -0400
From:      Dan Langille <dan@langille.org>
To:        freebsd-scsi@freebsd.org
Subject:   Re: Does the tape library need cleaning?
Message-ID:  <0D43CD5E-89F7-4A1C-A0C3-6DBA8039F367@langille.org>
In-Reply-To: <C11C1FC4-8D39-4503-9CFF-00DC8544987D@langille.org>
References:  <C11C1FC4-8D39-4503-9CFF-00DC8544987D@langille.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On May 28, 2011, at 6:03 PM, Dan Langille wrote:

> I'm wondering if there is a way to query my tape library to see if =
cleaning is required?  This information is shown on the display of the =
unit, but I'd like to query the device and display it on a webpage.
>=20
> Here is what I have.
>=20
> $ mtx -f /dev/pass11 inquiry
> Product Type: Medium Changer
> Vendor ID: 'DEC     '
> Product ID: 'TL800    (C) DEC'
> Revision: '0326'
> Attached Changer API: No
>=20
> I'm guessing I need to know more about about the scsi commands I can =
send to the device and use camcontrol to extract the information.  Much =
like this command pulls back data (as extracted from a a:
>=20
>=20
>  set -- `camcontrol cmd $tape -v -t 3 -c "4d 0 43 0 0 0 0 0 40 0" -i =
64 \

Reading =
http://support.gateway.com/s/Manuals/servers/quantum_7000_product_manual.p=
df shows me that cleaning status detection is possible.

I started by understanding what my script (provided by a third partty) =
does.

Based on my script, I know that 43 is read statistics (as opposed to 42 =
which is write statistics).

So far, I've learned a bit about CDB and know that 4d =3D 'LOG SENSE'.

According to 5.4.8 LOG SENSE (4Dh), the third parameter, 43, seems to be =
the PC and Page Code.

43 =3D 0100 0101

* The 4 specifies cumulative values (see figure 5-20 LOG Page Control =
Definitions)
* The 3 specifies Last n Errors Events Page ( see figure 5-21 LOG SENSE =
Pages Supported)

Does this make sense to anyone else?



Section 5.4.8.6 Device Status Log Sense Page (3Eh) seems to have what I =
need. Particularly:

* parameter code (0001h)
* ASC 80h ASCQ  01h  =3D=3D Cleaning Required

It is at this point that I start getting confused about what camcontrol =
command I should use.

I don't know how to incorporate 3E into the camcontrol command.  It =
seems that 4D is the key....

I'm confused...



>    "{skip} *i4 \
>     {skip} *i4 \
>     {Corrected errors with substantial delay   } i4 \
>     {skip} *i4 \
>     {Corrected errors with possible delay      } i4 \
>     {skip} *i4 \
>     {Total errors                              } i4 \
>     {skip} *i4 \
>     {Total errors corrected                    } i4 \
>     {skip} *i4 \
>     {Total times correction algorithm processed} i4 \
>     {skip} *i4 \
>     {Total bytes processed                     } i2 i3 i3 \
>     {skip} *i4 \
>     {Total uncorrected errors                  } i4"

The above output is related to Table 5-18 on page 114.

>  `
>  echo "                Corrected errors with substantial delay: $1"
>  echo "                Corrected errors with possible delay   : $2"
>  echo "                Total errors                           : $3"
>  echo "                Total errors corrected                 : $4"
>  echo "                Total times correction algorithm used  : $5"
>  tmp=3D`echo "($6 * 16777216 + $7) * 16777216 + $8" | bc`
>  echo "                Total bytes processed                  : $tmp"

--=20
Dan Langille - http://langille.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0D43CD5E-89F7-4A1C-A0C3-6DBA8039F367>