Views:

Summary



This article describes using the tapedump utility to access and troubleshoot tape drives.

Step By Step



Procedure

DPX provides a command-line utility that is frequently used to configure tape libraries, and diagnose/troubleshoot tape drive issues.  This utility is called tapedump and is located in the bin directory of DPX.  The utility provides a way of performing all standard tape operations outside of DPX.

 

Minimal tapedump session

The following steps demonstrate a minimal tapedump session and are used to test connectivity to the tape drive by simply opening it for access, rewinding the tape and then unloading the tape from the drive.  In order for the open operation to succeed, you must have a tape loaded into the drive.  This condition is useful for mapping tape drives when configuring a jukebox. First, execute tapedump with no arguments from the command shell on the operating system, e.g.

  • UNIX:                /opt/DPX/bin/tapedump
  • Windows:          C:\Program Files\DPX\bin\tapedump.exe
  • NW:                  loadSYS:\BackEx\bin\tapedump.nlm

You will then get a prompt, indicating you should enter a command to execute.

bash-2.05a$ ./tapedump.exe

tp log file is (C:\Program Files\DPX\logs\000008a0.tpl) msg file is (C:\Program Files\DPX\bin\snbmsg.txt)

Thu Oct 03 14:58:56 2002 SNBTPS5877I Using NT Tape Driver io

Thu Oct 03 14:58:56 2002 SNBTAP1279I TAPEDUMP : Nodename (EHANSEN), OS (Windows_NT) Release (5.0), Machine (EHANSEN), Architecture

Enter command to execute , enter (help) for help , (quit) for quit

 

Note that information from this tapedump session is automatically being logged to the file 000008a0.tpl in the logs directory of DPX.  If you are troubleshooting a problem with tapedump, you will need to mail this file to the Catalogic Software engineer.

Before you can issue any commands with tapedump, you need to tell tapedump the file handle for the tape drive device driver.  This file handle is installed when you install the device drivers on the operating system.  If this file handle is inaccessible, you must install the device drivers or there is a problem with your driver/operating system and you should consult the O/S and tape drive manufacturer. We will specify operation of the first tape drive found by the O/S with the "tape" command, e.g.

  • Windows:     tape \\.\Tape0
  • Netware (Before Backup Express version 2.1.5):     tape SYS:\ETC\TAPE1
  • Netware (Backup Express version 2.1.5 and above):     tape tape0_596_1_6
  • UNIX, e.g. Solaris:     tape /dev/rmt/0cn

Therefore, our tapedump session now looks like this, where this is Windows running a www.cygwin.com/ bash shell.

     ...

     Enter command to execute , enter (help) for help , (quit) for quit

     tape \\.\Tape0

     Thu Oct 03 15:22:46 2002 SNBTAP1279I cmd CHTAPE \\.\Tape0

     Thu Oct 03 15:22:46 2002 SNBTAP1279I end cmd CHTAPE

     Enter command to execute , enter (help) for help , (quit) for quit

 

Next, we "open" the tape drive.  This is the operation that actually communicates with the tape drive based on the file handle of the device driver.  The open command must contain one of two options, either open read/write "rdwr" or open the drive for read-only access only "rdonly".  We open the drive for readonly access and our tapeump session reads as follows.

     ...

     Enter command to execute , enter (help) for help , (quit) for quit

     open rdonly

     Thu Oct  3 15:21:28 2002 SNBTAP1279I cmd OPENDEV \\.\Tape0 rdonly

     open opt is (RDONLY)

     Thu Oct  3 15:21:29 2002 SNBTAP1279I end cmd OPENDEV

     Enter command to execute , enter (help) for help , (quit) for quit

 

This indicates that we successfully communicated with the tape drive by opening it for access.  We can now issue commands, such as rewind and unload, e.g:

     ...

     Enter command to execute , enter (help) for help , (quit) for quit

     rewind

     Thu Oct  3 15:23:30 2002 SNBTAP1279I cmd REWDEV \\.\Tape0

     Thu Oct  3 15:23:30 2002 SNBTAP1279I end cmd REWDEV

     Enter command to execute , enter (help) for help , (quit) for quit

     unload

     Thu Oct  3 15:23:34 2002 SNBTAP1279I cmd UNLOAD \\.\Tape0

     Thu Oct  3 15:23:54 2002 SNBTAP1279I end cmd UNLOAD

     Enter command to execute , enter (help) for help , (quit) for quit

 

These commands successfully completed with no errors.  Note that if you quit tapedump, rerun tapedump, and try to open this tape drive you will get an error that indicates there is no media in the tape drive.

 

Additional tapedump Commands

Tapedump provides a series of commands that you can use to query information on the tape, troubleshoot hardware problems, and provide performance statistics on the tape drive capabilities.  A complete listing of the tapedump commands and an explanation is as follows.

  • tape<parm1>                : Specify the device driver file handle tapedump will operate on for this tapedump session with <parm1>
  • output<parm1>             : Reset output file to write data to <parm1>
  • display                          : Display tape and output file name
  • lock                              : Lock current tape for access
  • unlock                          : Unlock current tape for access
  • rewind                          : Rewind the current tape
  • fsf<parm1>                   : Fast-forward Filemark on the tape <parm1> times
  • bsf<parm1>                  : Back-space Filemark on the tape <parm1> times
  • fsr<parm1>                   : Fast-forward Record on the tape <parm1> times
  • bsr<parm1>                  : Back-Space Record on the tape <parm1> times
  • read                             : Read the next logical record
  • wfm<parm1>               : Write filemarks <parm1> times
  • open                            : Open current tape drive file handle for access
  • unload                         : Unload the tape from the drive
  • write<parm1>              : Write current buffer size of the first character of <parm1>
  • chbuf<parm1>              : Change the buffer size for tape writes to <parm1> bytes
  • close<parm1>              : Close the tape device
  • perfwrite<file> <numwrites> fix/var   : Will read buffer size from <file> and write <numwrites> times to the tape drive in either fixed or variable length records.
  • perfread<numreads> <fsr/nofsr>      : Will read buffer size from tape  <numreads> times.. if fsr then will fsr 1 between each read.
  • debug                           : Will turn debug on
  • cmdfile<filename>         : Will read the commands from filename

Example session:

  • $ ./tapedump                Run the tapedump command
  • tape/dev/rmt/0c             Specify the tape device to use
  • openrdwr                      Open for reading & writing
  • rewind                          Go to beginning of tape
  • chbuf80                        Set blocksize to 80 bytes
  • write                          Write an 80-byte block filled with the character 'a'
  • wfm1                            Write a filemark
  • chbuf512                      Set blocksize to 512 bytes
  • writeb                           Write a 512-byte block filled with the character 'b'
  • writeb
  • chbuf32768                   Set blocksize to 32K
  • write                          Write a 32K block filled with the character 'c'
  • wfm2                            Write 2 filemarks (End-Of-Tape)
  • rewind                           Go back to beginning of tape
  • read (repeat for a total of 8 times)      Read the blocks & filemarks
  • rewind                           Go back to beginning of tape
  • unload                           Unload the tape from the drive