<chapter id="bkuptapedevice-42512"><title>Managing Tape Drives (Tasks)</title><highlights><para>This chapter describes how to manage tape drives in the <trademark>Solaris</trademark> Operating
System (Solaris OS).</para><para>This is a list of the step-by-step instructions in this chapter.</para><itemizedlist><listitem><para><olink targetptr="bkuptapedevice-95688" remap="internal">How to Display Tape Drive
Status</olink></para>
</listitem><listitem><para><olink targetptr="bkuptapedevice-18" remap="internal">Retensioning a Magnetic Tape
Cartridge</olink></para>
</listitem><listitem><para><olink targetptr="bkuptapedevice-19" remap="internal">Rewinding a Magnetic Tape Cartridge</olink></para>
</listitem>
</itemizedlist><para>This is a list of overview information in this chapter.</para><itemizedlist><listitem><para><olink targetptr="bkuptapedevice-26951" remap="internal">Choosing Which Media to Use</olink></para>
</listitem><listitem><para><olink targetptr="bkuptapedevice-27909" remap="internal">Backup Device Names</olink></para>
</listitem><listitem><para><olink targetptr="bkuptapedevice-6" remap="internal">Displaying Tape Drive Status</olink></para>
</listitem><listitem><para><olink targetptr="bkuptapedevice-16" remap="internal">Guidelines for Drive Maintenance
and Media Handling</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="bkuptapedevice-26951"><title>Choosing Which Media to Use</title><para>You typically back up Solaris systems by using the following tape media:</para><itemizedlist><listitem><para>1/2-inch reel tape</para>
</listitem><listitem><para>1/4-inch streaming cartridge tape</para>
</listitem><listitem><para>8-mm cartridge tape</para>
</listitem><listitem><para>4-mm cartridge tape (DAT)</para>
</listitem>
</itemizedlist><para>You can perform backups with diskettes, but doing so is time-consuming and cumbersome.</para><para>The media that you choose depends on the availability of the equipment that
supports it and of the media (usually tape) that you use to store the files. Although
you must do the backup from a local system, you can write the files to a remote device. </para><para>The following table
shows typical tape devices that are used for backing up file systems. The storage
capacity for each device depends on the type of drive and the data being written to
the tape.</para><table frame="topbot" id="bkuptapedevice-84753"><title>Media Storage Capacities</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="264*"/><colspec colname="column2" colwidth="132*"/><thead><row rowsep="1"><entry><para>Backup Media</para>
</entry><entry><para>Storage Capacity </para>
</entry>
</row>
</thead><tbody><row><entry><para>1/2-inch reel tape</para>
</entry><entry><para>140 Mbytes (6250 bpi)</para>
</entry>
</row><row><entry><para>2.5-Gbyte 1/4-inch cartridge (QIC) tape</para>
</entry><entry><para>2.5 Gbytes</para>
</entry>
</row><row><entry><para>DDS3 4-mm cartridge tape (DAT)</para>
</entry><entry><para>12&ndash;24 Gbytes</para>
</entry>
</row><row><entry><para>14-Gbyte 8-mm cartridge tape</para>
</entry><entry><para>14 Gbytes</para>
</entry>
</row><row><entry><para>DLT 7000 1/2-inch cartridge tape</para>
</entry><entry><para>35&ndash;70 Gbytes</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1><sect1 id="bkuptapedevice-27909"><title>Backup Device Names</title><para>You specify a tape or diskette to use for backup by supplying a logical device
name. This name points to the subdirectory that contains the &ldquo;raw&rdquo; device
file and includes the logical unit number of the drive. Tape drive naming conventions
use a logical, not a physical, device name. The following table shows this naming
convention.</para><table frame="topbot" id="bkuptapedevice-75330"><title>Basic Device Names for Backup
Devices</title><tgroup cols="2" colsep="0" rowsep="1"><colspec colname="column1" colwidth="87*"/><colspec colname="column2" colwidth="272*"/><thead><row><entry><para>Device Type</para>
</entry><entry><para>Name</para>
</entry>
</row>
</thead><tbody><row rowsep="0"><entry><para>Tape</para>
</entry><entry><para><filename>/dev/rmt/</filename><replaceable>n</replaceable></para>
</entry>
</row><row><entry><para>Diskette</para>
</entry><entry><para><filename>/vol/dev/rdiskette0/unlabeled</filename></para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>In general, you specify a tape device as shown in the following figure.</para><figure id="bkuptapedevice-fig-1"><title id="bkuptapedevice-43001">Tape Drive Device
Names</title><mediaobject><imageobject><imagedata entityref="fig3670.epsi"/>
</imageobject><textobject><simpara>Illustration shows logical tape device name that includes magnetic
tape device directory, drive, and the optional density values.</simpara>
</textobject>
</mediaobject>
</figure><para>If you don't specify the density, a tape drive typically writes at its &ldquo;preferred&rdquo;
density. The preferred density usually means the highest density the tape drive supports.
Most SCSI drives can automatically detect the density or format on the tape and read
it accordingly. To determine the different densities that are supported for a drive,
look at the <filename>/dev/rmt</filename> subdirectory. This subdirectory includes
the set of tape device files that support different output densities for each tape.</para><para>Also, a SCSI controller can have a maximum of seven SCSI tape drives.</para><sect2 id="bkuptapedevice-4"><title>Specifying the Rewind Option for a Tape Drive</title><para>Normally, you specify a tape drive by its logical unit number, which can run
from 0 to <replaceable>n</replaceable>. The following table describes how to specify
tape device names with a rewind or a no-rewind option.</para><table frame="topbot" id="bkuptapedevice-15503"><title>Specifying Rewind or No-Rewind
for a Tape Drive</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="220*"/><colspec colname="column2" colwidth="176*"/><thead><row rowsep="1"><entry><para>Drive and Rewind Value</para>
</entry><entry><para>Use This Option</para>
</entry>
</row>
</thead><tbody><row><entry><para>First drive, rewind</para>
</entry><entry><para><filename>/dev/rmt/0</filename></para>
</entry>
</row><row><entry><para>First drive, no rewind</para>
</entry><entry><para><filename>/dev/rmt/0n</filename></para>
</entry>
</row><row><entry><para>Second drive, rewind</para>
</entry><entry><para><filename>/dev/rmt/1</filename></para>
</entry>
</row><row><entry><para>Second drive, no rewind</para>
</entry><entry><para><filename>/dev/rmt/1n</filename></para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="bkuptapedevice-5"><title>Specifying Different Densities for a Tape Drive</title><para>By default, the drive writes at its &ldquo;preferred&rdquo; density, which is
usually the highest density the tape drive supports. If you do not specify a tape
device, the command writes to drive number 0 at the default density the device supports.</para><para>To transport a tape to a system whose tape drive supports only a certain density,
specify a device name that writes at the desired density. The following table describes
how to specify different densities for a tape drive.</para><table frame="topbot" id="bkuptapedevice-10539"><title>Specifying Different Densities
for a Tape Drive</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="220*"/><colspec colname="column2" colwidth="176*"/><thead><row><entry><para>Drive, Density, and Rewind Value</para>
</entry><entry><para>Use This Option</para>
</entry>
</row>
</thead><tbody><row><entry><para>First drive, low density, rewind</para>
</entry><entry><para><filename>/dev/rmt/0l</filename></para>
</entry>
</row><row><entry><para>First drive, low density, no rewind</para>
</entry><entry><para><filename>/dev/rmt/0ln</filename></para>
</entry>
</row><row><entry><para>Second drive, medium density, rewind</para>
</entry><entry><para><filename>/dev/rmt/1m</filename></para>
</entry>
</row><row><entry><para>Second drive, medium density,  no rewind</para>
</entry><entry><para><filename>/dev/rmt/1mn</filename></para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>The additional density values are shown in <olink targetptr="bkuptapedevice-27909" remap="internal">Backup Device Names</olink>.</para>
</sect2>
</sect1><sect1 id="bkuptapedevice-6"><title>Displaying Tape Drive Status</title><para>You can use the <command>status</command> option with the <command>mt</command> command
to get status information about tape drives. The <command>mt</command> command reports
information about any tape drives that are described in the <filename>/kernel/drv/st.conf</filename> file.</para><task id="bkuptapedevice-95688"><title>How to Display Tape Drive Status</title><procedure><step id="bkuptapedevice-step-8"><para>Load a tape into the drive you want information
about. </para>
</step><step id="bkuptapedevice-step-9"><para>Display the tape drive status.</para><screen># <userinput>mt -f /dev/rmt/</userinput><replaceable>n</replaceable> <userinput>status</userinput></screen>
</step><step id="bkuptapedevice-step-10"><para>Repeat steps 1&ndash;2, substituting tape
drive numbers 0, 1, 2, 3, and so on to display information about all available tape
drives.</para>
</step>
</procedure><example id="fncqh"><title>Displaying Tape Drive Status</title><para>The following example shows the status for a QIC-150 tape drive (<filename>/dev/rmt/0</filename>):</para><screen>$ <userinput>mt -f /dev/rmt/0 status</userinput>
Archive QIC-150 tape drive:
   sense key(0x0)= No Additional Sense   residual= 0   retries= 0
   file no= 0   block no= 0</screen><para>The following example shows the status for an Exabyte tape drive (<filename>/dev/rmt/1</filename>):</para><screen>$ <userinput>mt -f /dev/rmt/1 status</userinput>
Exabyte EXB-8200 8mm tape drive:
sense key(0x0)= NO Additional Sense residual= 0  retries= 0
file no= 0   block no= 0</screen><para>The following example shows a quick way to poll a system and locate all of its
tape drives: </para><screen>$ <userinput>for drive in 0 1 2 3 4 5 6 7</userinput>
> <userinput>do</userinput>
> <userinput>mt -f /dev/rmt/$drive status</userinput>
> <userinput>done</userinput>
Archive QIC-150 tape drive:
   sense key(0x0)= No Additional Sense   residual= 0   retries= 0
   file no= 0   block no= 0
/dev/rmt/1: No such file or directory
/dev/rmt/2: No such file or directory
/dev/rmt/3: No such file or directory
/dev/rmt/4: No such file or directory
/dev/rmt/5: No such file or directory
/dev/rmt/6: No such file or directory
/dev/rmt/7: No such file or directory
$ </screen>
</example>
</task>
</sect1><sect1 id="bkuptapedevice-13"><title>Handling Magnetic Tape Cartridges</title><para>If errors occur when a tape is being read, you can retension the tape, clean
the tape drive, and then try again.</para><sect2 id="bkuptapedevice-18"><title>Retensioning a Magnetic Tape Cartridge</title><para>Retension a magnetic tape cartridge with the <command>mt</command> command.</para><para>For example:</para><screen>$ <userinput>mt -f /dev/rmt/1 retension</userinput>
$</screen><note><para>Do not retension non-QIC tape drives.</para>
</note>
</sect2><sect2 id="bkuptapedevice-19"><title>Rewinding a Magnetic Tape Cartridge</title><para>To rewind a magnetic tape cartridge, use the <command>mt</command> command.</para><para>For example:</para><screen>$ <userinput>mt -f /dev/rmt/1 rewind</userinput>
$</screen>
</sect2>
</sect1><sect1 id="bkuptapedevice-16"><title>Guidelines for Drive Maintenance and Media Handling</title><para>A backup tape that cannot be read is useless. So, periodically clean and check
your tape drives to ensure correct operation. See your hardware manuals for instructions
on procedures for cleaning a tape drive. You can check your tape hardware by doing
either of the following:</para><itemizedlist><listitem><para>Copying some files to the tape, reading the files back, and then comparing
the original files with the copied files.</para>
</listitem><listitem><para>Using the <option>v</option> option of the <command>ufsdump</command> command
to verify the contents of the media with the source file system. The file system must
be unmounted or completely idle for the <option>v</option> option to be effective. </para>
</listitem>
</itemizedlist><para>Be aware that hardware can fail in ways that the system does not report.</para><para>Always label your tapes after a backup. If you are using a backup strategy similar
to the strategies suggested in <olink targetptr="bkupconcepts-57422" remap="internal">Chapter&nbsp;23, Backing Up and Restoring File Systems (Overview)</olink>, you should indicate on the
label &ldquo;Tape A,&rdquo; &ldquo;Tape B,&rdquo; and so forth. This label should
never change. Every time you do a backup, make another tape label that contains the
following information:</para><itemizedlist><listitem><para>The backup date</para>
</listitem><listitem><para>The name of the machine and file system that is backed up</para>
</listitem><listitem><para>The backup level</para>
</listitem><listitem><para>The tape number (1 of <replaceable>n</replaceable>, if the backup
spans multiple volumes)</para>
</listitem><listitem><para>Any information specific to your site</para>
</listitem>
</itemizedlist><para>Store your tapes in a dust-free safe location, away from magnetic equipment.
Some sites store archived tapes in fireproof cabinets at remote locations. </para><para>You should create and maintain a log that tracks which media (tape volume) stores
each job (backup) and the location of each backed-up file.</para>
</sect1>
</chapter>