System Administration Guide, Volume 1

Chapter 47 Managing Tape Drives (Tasks)

This chapter describes how to manage tape drives.

Here is a list of the step-by-step instructions in this chapter:

Choosing Which Media to Use

You typically back up Solaris systems using:

You can perform backups using diskettes, but this is time-consuming and cumbersome.

The media 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.

The table below shows typical media used for backing up file systems and shows the storage capacity for each. Capacity depends on the type of drive and the data being written to the tape.

Table 47-1 Media Storage Capacities

Media 

Capacity  

1/2-inch reel tape 

140 Mbytes (6250 bpi) 

2.5-Gbyte 1/4 inch cartridge (QIC) tape 

2.5 Gbytes 

DDS3 4-mm cartridge tape (DAT) 

12 - 24 Gbytes 

14-Gbyte 8-mm cartridge tape 

14 Gbytes 

DLTTM 7000 1/2-inch cartridge tape

35 - 70 Gbytes 

Backup Device Names

You specify a tape or diskette drive to use for backup by supplying a logical device name. This name points to the subdirectory containing the "raw" device file and includes the logical unit number of the drive. Tape drive naming conventions use a logical, not a physical, device name. The table below shows this naming scheme.

Table 47-2 Basic Device Names for Backup Devices

Device Type 

Name 

Tape 

/dev/rmt/n

Diskette 

/vol/dev/rdiskette0/unlabeled

In general, you specify a tape drive device as shown in the figure below.

Figure 47-1 Tape Drive Device Names

Graphic

If you don't specify the density, a tape drive typicallys write at its "preferred" density, which usually means the highest density it supports. Most SCSI drives can automatically sense 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 /dev/rmt subdirectory, which includes the set of tape device files that support different output densities for each tape.

Also, a SCSI controller can have a maximum of seven SCSI tape drives.

Specifying the Default Density for a Tape Drive

Normally, you specify a tape drive by its logical unit number, which can run from 0 to n. The table below describes how to specify tape device names using default density settings.

Table 47-3 Specifying Default Densities for a Tape Drive

To Specify The ... 

Use ... 

First drive, rewinding 

/dev/rmt/0

First drive, nonrewinding 

/dev/rmt/0n

Second drive, rewinding 

/dev/rmt/1

Second drive, nonrewinding 

/dev/rmt/1n

By default, the drive writes at its "preferred" density, which is usually the highest density it supports. If you do not specify a tape device, the command writes to drive number 0 at the default density the device supports.

Specifying Different Densities for a Tape Drive

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 table below describes how to specify different densities for a tape drive.

Table 47-4 Specifying Different Densities for a Tape Drive

To Specify The ... 

Use ... 

First drive, low density, rewinding 

/dev/rmt/0l

First drive, low density, nonrewinding 

/dev/rmt/0ln

Second drive, medium density, rewinding 

/dev/rmt/1m

Second drive, nonrewinding, medium density 

/dev/rmt/1mn

The unit and density characters are shown in Figure 47-1.

Displaying Tape Drive Status

You can use the status option with the mt command to get status information about tape drives. The mt command reports information about any tape drives described in the /kernel/drv/st.conf file.

How to Display Tape Drive Status

  1. Load a tape into the drive you want information about.

  2. Display tape drive status with the mt command.


    # mt -f /dev/rmt/n status
    
  3. Repeat steps 1-2, substituting tape drive numbers 1, 2, 3, and so on to display information about all available tape drives.

Example-- Displaying Tape Drive Status

The following example shows status for a QIC-150 tape drive (/dev/rmt/0) and an Exabyte tape drive (/dev/rmt/1).


$ mt -f /dev/rmt/0 status
Archive QIC-150 tape drive:
   sense key(0x0)= No Additional Sense   residual= 0   retries= 0
   file no= 0   block no= 0
$ mt -f /dev/rmt/1 status
Exabyte EXB-8200 8mm tape drive:
sense key(0x0)= NO Additional Sense residual= 0  retries= 0
file no= 0   block no= 0

The following example shows a quick way to poll a system and locate all of its tape drives.


$ for drive in 0 1 2 3 4 5 6 7
> do
> mt -f /dev/rmt/$drive status
> done
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
$ 

Handling Magnetic Tape Cartridges

If errors occur when reading a tape, retension the tape, clean the tape drive, and then try again.

How to Retension a Magnetic Tape Cartridge

Retension a magnetic tape cartridge with the mt command.


$ mt -f /dev/rmt/n retension

Example--How to Retension a Magnetic Tape Drive

The following example retensions the tape in drive /dev/rmt/1.


$ mt -f /dev/rmt/1 retension
$

Note -

Do not retension non-QIC tape drives.


How to Rewind a Magnetic Tape Cartridge

To rewind a magnetic tape cartridge, use the mt command.


$ mt -f /dev/rmt/n rewind

Example--Rewinding a Magnetic Tape Cartridge

The following example rewinds the tape in drive /dev/rmt/1.


$ mt -f /dev/rmt/1 rewind
$

Guidelines for Drive Maintenance and Media Handling

A backup tape that cannot be read is useless. It is a good idea to clean and check your tape drives periodically to ensure correct operation. See your hardware manuals for instructions on procedures for cleaning a tape drive. You can check your tape hardware by:

Be aware that hardware can fail in ways that the system does not report.

Always label your tapes after a backup. If you have planned a backup strategy similar to those suggested in Chapter 42, Backing Up and Restoring File Systems (Overview), you should indicate on the label "Tape A," "Tape B," and so forth. This label should never change. Every time you do a backup, make another tape label containing the backup date, the name of the machine and file system backed up, backup level, the tape number (1 of n, if it spans multiple volumes), plus any information specific to your site. Store your tapes in a dust-free safe location, away from magnetic equipment. Some sites store archived tapes in fireproof cabinets at remote locations.

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.