When is a cleaning tape needed?

As part of my magical Bacula website, I wanted to know when my tape drive required a cleaning tape. It appears that smartctl will reveal this information:

[dan@kraken:/usr/home/dan] $ sudo /usr/local/sbin/in/smartctl -d scsi -x /dev/nsa0
Password:
smartctl 5.39.1 2010-01-28 r3054 [FreeBSD 8.2-STABLE amd64] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

Device: DEC      TZ89     (C) DEC Version: 2561
Serial number: CXA02S1766
Device type: tape
Local Time is: Tue Jun 21 00:22:26 2011 UTC
Temperature Warning Disabled or Not Supported
TapeAlert Supported
TapeAlert Errors (C=Critical, W=Warning, I=Informational):
[0x14] C: The tape drive needs cleaning:
  1. If the operation has stopped, eject the tape and clean the drive.
  2. If the operation has not stopped, wait for it to finish and then
  clean the drive.
  Check the tape drive users manual for device specific cleaning instructions.

Error counter log:
           Errors Corrected by           Total   Correction     Gigabytes    Total
               ECC          rereads/    errors   algorithm      processed    uncorrected
           fast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
read:          0        0         0         0          0          0.023           0
write:         0        0        15        15          0          3.611           0

Last n error events log page
  Error event 0:
    Packet # 211 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22282/353/0A4E0714/1/80/02/00
                                                                                                                                                                       
  Error event 1:
     
  Error event 2:
    Packet # 212 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22307/353/0A4E7DB4/1/80/02/00
                                                                                                                                                                       
  Error event 3:
     
  Error event 4:
    Packet # 213 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22309/353/0A4EB06D/1/80/02/00
                                                                                                                                                                       
  Error event 5:
     
  Error event 6:
    Packet # 214 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22313/353/0A4E7DB4/1/80/02/00
                                                                                                                                                                       
  Error event 7:
     
  Error event 8:
    Packet # 215 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22318/353/0A4E7DB4/1/80/02/00
                                                                                                                                                                       
  Error event 9:
     
  Error event 10:
    Packet # 216 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22337/353/7098FB99/1/80/02/00
                                                                                                                                                                       
  Error event 11:
     
  Error event 12:
    Packet # 217 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22361/353/7098FB99/1/80/02/00
                                                                                                                                                                       
  Error event 13:
     
  Error event 14:
    Packet # 218 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22385/353/7098FB99/1/80/02/00
                                                                                                                                                                       
  Error event 15:
     
  Error event 16:
    Packet # 219 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22409/353/7098FB99/1/80/02/00
                                                                                                                                                                       
  Error event 17:
     
  Error event 18:
    Packet # 220 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22433/353/0A4EA033/1/80/02/00
                                                                                                                                                                       
  Error event 19:
     
  Error event 20:
    Packet # 221 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22457/353/0A4EA033/1/80/02/00
                                                                                                                                                                       
  Error event 21:
     
  Error event 22:
    Packet # 222 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22458/353/0A4EB06D/1/80/02/00
                                                                                                                                                                       
  Error event 23:
     
  Error event 24:
    Packet # 223 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22481/353/0A4EA033/1/80/02/00
                                                                                                                                                                       
  Error event 25:
     
  Error event 26:
    Packet # 224 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22505/353/0A4EA033/1/80/02/00
                                                                                                                                                                       
  Error event 27:
     
  Error event 28:
    Packet # 225 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22506/353/0A4EB06D/1/80/02/00
                                                                                                                                                                       
  Error event 29:
     
  Error event 30:
    Packet # 226 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22560/353/16A280CB/1/80/02/00
                                                                                                                                                                       
  Error event 31:
     
  Error event 32:
    Packet # 227 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22602/353/48C6831E/1/80/02/00
                                                                                                                                                                       
  Error event 33:
     
  Error event 34:
    Packet # 228 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22625/353/0A4E7213/1/80/02/00
                                                                                                                                                                       
  Error event 35:
     
  Error event 36:
    Packet # 229 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22626/353/48C6831E/1/80/02/00
                                                                                                                                                                       
  Error event 37:
     
  Error event 38:
    Packet # 230 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22649/353/0A4E7213/1/80/02/00
                                                                                                                                                                       
  Error event 39:
     
  Error event 40:
    Packet # 231 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22650/353/48C6831E/1/80/02/00
                                                                                                                                                                       
  Error event 41:
     
  Error event 42:
    Packet # 232 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22673/353/0A4E7213/1/80/02/00
                                                                                                                                                                       
  Error event 43:
     
  Error event 44:
    Packet # 233 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22674/353/48C6831E/1/80/02/00
                                                                                                                                                                       
  Error event 45:
     
  Error event 46:
    Packet # 234 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22697/353/0A4E7213/1/80/02/00
                                                                                                                                                                       
  Error event 47:
     
  Error event 48:
    Packet # 235 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22721/353/0A4E7213/1/80/02/00
                                                                                                                                                                       
  Error event 49:
     
  Error event 50:
    Packet # 236 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22793/353/4F5B1D10/1/80/02/00
                                                                                                                                                                       
  Error event 51:
     
  Error event 52:
    Packet # 237 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22817/353/4F5B1D10/1/80/02/00
                                                                                                                                                                       
  Error event 53:
     
  Error event 54:
    Packet # 238 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22833/353/4F5B1D10/1/80/02/00
                                                                                                                                                                       
  Error event 55:
     
  Error event 56:
    Packet # 239 - Event: A401  [V97-0  29-DEC-1999]  616:41:33.323  POH/PC= 22841/353
       11004F5B 1D100101 00400000 10100027 65B20000 0A0B0000 00000000 00000000
       00060001 A1920000 00000000 00000000 00000000 00000000 00000000 00000000
       0000
  Error event 57:
    0000 00000000 00000000 00000000

  Error event 58:
    Packet # 240 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22841/353/4F5B1D10/3/0C/00/00
                                                                                                                                                                       
  Error event 59:
     
  Error event 60:
    Packet # 241 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22841/353/4F5B1D10/3/0C/00/00
                                                                                                                                                                       
  Error event 61:
     
  Error event 62:
    Packet # 242 - Event: A401  [V97-0  29-DEC-1999]  616:42:05.351  POH/PC= 22841/353
       11004F5B 1D100101 00400000 13000027 65D60000 0A0C0000 00000000 00000000
       00060001 A19F0000 00000000 00000000 00000000 00000000 00000000 00000000
       0000
  Error event 63:
    0000 00000000 00000000 00000000

  Error event 64:
    Packet # 243 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22841/353/4F5B1D10/3/80/01/00
                                                                                                                                                                       
  Error event 65:
     
  Error event 66:
    Packet # 244 - Event: A401  [V97-0  29-DEC-1999]  616:42:34.111  POH/PC= 22841/353
       11004F5B 1D100101 00400000 13000027 65D60000 0A0C0000 00000000 00000000
       00060001 A3860000 00000000 00000000 00000000 00000000 00000000 00000000
       0000
  Error event 67:
    0000 00000000 00000000 00000000

  Error event 68:
    Packet # 245 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22841/353/4F5B1D10/3/0C/00/00
                                                                                                                                                                       
  Error event 69:
     
  Error event 70:
    Packet # 246 - Event: A401  [V97-0  29-DEC-1999]  617:19:25.841  POH/PC= 22842/353
       11004F5B 912A0101 00400000 10100003 65A80000 0A1C0000 00000000 00000000
       00020002 86640000 00000000 00000000 00000000 00000000 00000000 00000000
       0000
  Error event 71:
    0000 00000000 00000000 00000000

  Error event 72:
    Packet # 247 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22842/353/4F5B912A/3/0C/00/00
                                                                                                                                                                       
  Error event 73:
     
  Error event 74:
    Packet # 248 - Event: A401  [V97-0  29-DEC-1999]  617:19:58.191  POH/PC= 22842/353
       11004F5B 912A0101 00400000 13000003 65CC0000 0A1D0000 00000000 00000000
       00020002 866C0000 00000000 00000000 00000000 00000000 00000000 00000000
       0000
  Error event 75:
    0000 00000000 00000000 00000000

  Error event 76:
    Packet # 249 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22842/353/4F5B912A/3/80/01/00
                                                                                                                                                                       
  Error event 77:
     
  Error event 78:
    Packet # 250 - Event: A401  [V97-0  29-DEC-1999]  617:20:27.305  POH/PC= 22842/353
       11004F5B 912A0101 00400000 13000003 65CC0000 0A1D0000 00000000 00000000
       00020002 88520000 00000000 00000000 00000000 00000000 00000000 00000000
       0000
  Error event 79:
    0000 00000000 00000000 00000000

  Error event 80:
    Packet # 251 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22842/353/4F5B912A/3/0C/00/00
                                                                                                                                                                       
  Error event 81:
     
  Error event 82:
    Packet # 252 - Event: A401  [V97-0  29-DEC-1999]  617:28:03.290  POH/PC= 22842/353
       11000A4E 21940101 00400000 10100001 65D90000 0A200000 00000000 00000000
       00020001 45A60000 00000000 00000000 00000000 00000000 00000000 00000000
       0000
  Error event 83:
    0000 00000000 00000000 00000000

  Error event 84:
    Packet # 253 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22842/353/0A4E2194/3/0C/00/00
                                                                                                                                                                       
  Error event 85:
     
  Error event 86:
    Packet # 254 - Event: A401  [V97-0  29-DEC-1999]  617:28:37.765  POH/PC= 22842/353
       11000A4E 21940101 00400000 13000001 65FE0000 0A210000 00000000 00000000
       00020001 45AC0000 00000000 00000000 00000000 00000000 00000000 00000000
       0000
  Error event 87:
    0000 00000000 00000000 00000000

  Error event 88:
    Packet # 255 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22842/353/0A4E2194/3/80/01/00
                                                                                                                                                                       
  Error event 89:
     
  Error event 90:
    Packet # 0 - Event: A401  [V97-0  29-DEC-1999]  617:29:08.860  POH/PC= 22842/353
       11000A4E 21940101 00400000 13000001 65FE0000 0A210000 00000000 00000000
       00020001 45AD0000 00000000 00000000 00000000 00000000 00000000 00000000
       000000
  Error event 91:
    00 00000000 00000000 00000000

  Error event 92:
    Packet # 1 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22842/353/0A4E2194/3/0C/00/00
                                                                                                                                                                         
  Error event 93:
     
  Error event 94:
    Packet # 2 - SCSI Event: POH/PC/MID/SK/ASC/ASCQ/AddErr=22889/353/4F5B6963/1/80/02/00
                                                                                                                                                                         
  Error event 95:
     
Device does not support Self Test logging
Device does not support Background scan results logging
scsiPrintSasPhy Log Sense Failed [unsupported field in scsi command]
[dan@kraken:/usr/home/dan] $ 

This information is available only upon the first query. The query clears the flag. I’ll need to write a script to detect, then store this flag.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

1 thought on “When is a cleaning tape needed?”

  1. Just because the drive requested cleaning, doesn’t mean the drive really needs to be cleaned.

    On freebsddiary.org you mention you’re using used tapes.

    If the first drive that had the tape loaded was a DLT 4k (or 8k or VS80 or…) then the calibration tracks will be different than those required by your DLT 7k drive. Or they may be written by a DLT 7k with a bad or worn head.

    In other words, if the cleaning light comes on (SK/ASC/ASCQ 1/80/08 from the log page 7 entries is cleaning requested) after the tape is loaded, you probably have bad calibration tracks.

    Load a known good tape, and if the cleaning light goes out, you don’t need to clean it unless you’re getting hard write or hard read errors from known good tapes.

    The MID (Media ID: example from event 94 above: 4F5B6963) is written in the header area of the tape (before usable area) by the first drive to receive the tape, and is a way to figure out if you have a particular tape that is causing issues. It is unrelated to the serial number of the tape, or any barcode. The only way to read it, is get the log page 7 (event log), then cause an event with that tape (such as a drive self test), then pull the log page 7 again.

    Get the DLT 7000 Product Manual PDF from Quantum.com to look up the SK/ASC/ASCQ codes.

Leave a Comment

Scroll to Top