Solaris Handbook for SMCC Peripherals
검색에만이 책은
PDF로 이 문서 다운로드

Setting Up a Tape Drive

3

Text Box(504x57)

This chapter describes how to configure tape drive devices using the Solaris operating environment.
This chapter contains the following information:
Requirements you must performpage 30
Adding a tape drive to your systempage 32
Tensioning a tape cartridgepage 34
Rewinding a tapepage 34
Cleaning a tape drivepage 34
Displaying the status of a tape drivepage 35
Performing data backupspage 36

Requirements

Before you start to configure the operating environment for a new tape drive, you must:

Note - If you did not follow the procedures in "Shutting Down the System" on page 3, the operating system may not recognize the new tape drive.

Text Box(504x57)

Managing Tape Drives

Text Box(504x120)

For information on managing tape drives, refer to the following sections in this chapter:
Adding a Tape Drivepage 32
Tensioning a 1/4-inch Tape Cartridgepage 34
Rewinding a Tapepage 34
Cleaning a Tape Drivepage 34
Displaying the Status of a Tape Drivepage 35
Performing Data Backups and Restorespage 36
For more information about tape drives, refer to the documentation that accompanies your hardware.

· Adding a Tape Drive

Text Box(504x34)

Text Box(504x33)

The SCSI address switch for tape drives is typically preset by the factory to SCSI target ID 4. If you have more than one tape drive, you must set the SCSI address switch of the second tape drive to an address other than SCSI target ID 4 or any other target ID present on the bus.
If you have more than one SCSI device, such as tape drive, you must set each SCSI address switch to a different target ID.
You can connect any number of tape drives to a single SCSI bus provided that the total cable length does not exceed 6 meters and SCSI addresses are available.

Note - Connecting more than 4 tape drives to a single SCSI bus can cause slower system performance. If you have disk drives on the SCSI bus, only 2 tape drives can be added.


CAUTION Caution - Each tape drive must have a unique SCSI target ID setting, the SCSI address switches on your tape drives may need to be set to different numbers than those shown in Table 3-1. For further information on device addresses, see the System Administration Guide.

Table 3-1
Tape DrivesSCSI Address Switch or Jumper Setting (Target ID)Device Address for Built-In SCSI Support
First external tape drive4*/dev/rmt/0l
or /dev/rmt/0m
or /dev/rmt/0h
or /dev/rmt/0u
or /dev/rmt/0c
Second external tape drive5/dev/rmt/1l
or /dev/rmt/1m
or /dev/rmt/1h
or /dev/rmt/1u
or /dev/rmt/1c
*Can be any unique address on the bus.
  1. Install the tape drive.

    For installation information, refer to the documentation that accompanies your hardware.

  2. Turn on the power to all external peripheral devices, this includes the tape drive that you plan to configure and the system.

    The system is booted (using the boot -r command) and the Solaris operating environment configures the system by assigning a device address to the tape drive.

Text Box(504x50)

· Tensioning a 1/4-inch Tape Cartridge

When you insert a blank tape cartridge into a 1/4-inch tape drive, you should perform a tensioning pass. This procedure runs the tape from one end to the other and ensures an even distribution of tension throughout the new tape.

Note - The retensioning command is not supported for Digital Data Storage (DDS) or 8mm devices.

To run a tensioning pass:
  1. Insert the new blank tape cartridge into the tape drive.

  2. Type:


  % mt -f /dev/rmt/unit number retension  

and press Return.

· Rewinding a Tape

To rewind a tape:
* Type:

  % mt -f /dev/rmt/unit number rewind  

· Cleaning a Tape Drive

Tape drives must be cleaned periodically. To clean a tape drive:
* Insert a cleaning cartridge into the tape drive.
Consult your hardware documentation for details.

· Displaying the Status of a Tape Drive

  1. Insert the tape into the tape drive and wait for the load to complete.


Note - Loading is complete when ALL LEDs are illuminated.

Imported image(504x103)


Note - If you have more than one tape drive connected to your system, execute the same command but change the device name from /dev/rmt/0 to /dev/rmt/1, /dev/rmt/2, and so on.

  • Your system is able to access the tape drive and a tape cartridge is present, if the following status is displayed:

  Archive QIC-150 tape drive:  
    sense key(0x0)= nosense     residual= 0 retries= 0  
    file no= 0    block no= 0  

sense key= nosense indicates that your system was able to access the tape and there were no errors. You can then use any of the backup commands described in the following sections.
  • The following information tells you that the tape drive was just reset, powered on, or a tape cartridge was recently installed.

  Archive QIC-150 tape drive:  
    sense key(0x6)= unit attention      residual= 0 retries= 0  
    file no= 0    block no=0  

In this case, execute the mt -f /dev/rmt/0 status command again until the sense key(0x6)= unit attention advisory message is replaced with the sense key(0x0)= nosense message.
  • If the following status is displayed, your system is unable to access the tape.

  /dev/rmt/0: no tape loaded or drive offline  

In this case, insert a tape and execute the mt -f /dev/rmt/0 status command again.
  • If the following status is displayed, your system is unable to communicate with the tape drive.

  no such file or directory  

In this case, verify the tape drive is powered on and is properly connected to the system.
iv>

Performing Data Backups and Restores

Although you can use any backup command, the ufsdump and ufsrestore commands are easier to use.
Before using these commands, determine whether the tape is ready to receive data by displaying the status of the tape drive. Refer to "Displaying the Status of a Tape Drive" on page 35.

Note - If you have a 5.0 Gbyte 4mm DDS device, use a blocking factor of 96 instead of the default factor of 20 to optimize performance. The blocking factor of 96 translates to 48 Kbytes per transfer.
For the 150 Mbyte 1/4-inch tape drive, the 2.3 Gbyte 8mm tape drive, the 5.0 Gbyte 8mm tape drive, and the Front-Load 1/2-inch tape drive, use a blocking factor of 126 instead of the default factor of 20 to optimize performance.

cpio Command

The cpio command copies files from a hard disk to a tape as well as from a tape to a hard disk.
If you need more than one tape to back up files that are on your hard disk, use this command. This feature of the cpio command is referred to as multiple-volume interchange.
If you need to back up only a few files, use the tar command or the ufsdump command. The tar command supports only single-volume interchange. The ufsdump command supports multi-volume interchanges.
Example 1:
The following example shows how to copy the files in your working directory called /work and all subdirectories to a tape drive with the device address or device name of /dev/rmt/0.

  example# cd /work  
  example# ls -R | cpio -ocB > /dev/rmt/0  

Example 2:
The next example explains how to copy the files that are located on your tape back to your hard disk:

  example# cd /work  
  example# cpio -icdB < /dev/rmt/0  

  • The c option indicates that header information has been written in ASCII format for portability.
  • The d option indicates that as many directories as needed will be created.
  • The B option, which you must use whenever you copy files or files systems to and from a tape drive, indicates that the input has a blocking factor of 5120 bytes to the record.

Note - You must use the same blocking factor when you retrieve or copy files from the tape to the hard disk as you did when you copied files from the hard disk to the tape. Therefore, you must specify the B option.

dd Command

This command converts and copies files with different data formats. The most common usage of this command is to transfer a file system or partition from your hard disk to a tape. You can also use it to copy files from one hard disk to another. If you use a device with a variable block size, you need to make sure that you use the same block size for copying the files from a hard disk to a tape and from a tape to a hard disk.
The following example shows how to write the file system or partition /user/sunsystem to a 4mm tape drive with device address or device name of /dev/rmt/0. The blocking factor is 96 in this example. This example has been optimized for a 5.0 Gbyte 4mm DDS device.
Example:

  example# dd if=/dev/dsk/c0t0d0s7 of=/dev/rmt/0 bs=96k  

ufsdump Command

The ufsdump command copies a file system that is on a hard disk to a tape. For more information about dump levels and schedules, see the System Administration Guide.

Note - All files must be part of one file system or one partition. If you want to copy files from different file systems or partitions, use the ufsdump command with the n option (no rewind); this allows you to use the same tape again.

Example:
The following example explains how to copy all files that are located on a disk drive in partition /dev/rdsk/c0t3d0s2 to a file (often referred to as a dump file) called /dev/rmt/2c in compressed mode.

  example# ufsdump 0ubf 96 /dev/rmt/2c /dev/rdsk/c0t3d0s2  

  • The 0 option represents the dump level. A level 0 dump copies the entire file system to a dump file, which in this case is called /dev/rmt/2. You can specify any number between 0 and 9.
  • The u option updates the dump record by adding an entry to the file /etc/dumpdates for each file system that is successfully copied. It updates the /etc/dumpdates file by adding the name of every file system, the date the file system was copied, and the dump level that was specified at that time.
  • The b option specifies the blocking factor that is used when the files are copied to the tape. The default blocking factor is 20. The blocking factor is 96 in this example. This example has been optimized for a 5.0 Gbyte 4mm DDS device. In general, the largest value (126) is best.
  • The f option specifies the device address or device name of the tape drive, which is /dev/rmt/2 in this example.
  • The l option specifies the loader mode. This causes the autoloader and library units to load in the next piece of media.
  • /dev/rdsk/c0t3d0s2 is the device name or address of the source device where you want to copy files. In this example, it is the second partition on the third hard disk that is connected to your system.

ufsrestore Command

The ufsrestore command copies file systems from a tape to a hard disk. It can only copy file systems that were previously copied from a hard disk to a tape with the ufsdump command.
Example:
The following example explains how to copy all files that are located on a tape drive in the /man directory to a hard disk with the device address or device name of /dev/rmt/0. However, you must first go to the directory into which you wish to copy the file systems or partitions before you retrieve or extract files. In this example, the directory into which all files systems or partitions are copied is disk2, and the blocking factor is 96. This example has been optimized for a 5.0Gbyte 4mm DDS device.

  example# cd /disk2  
  example# ufsrestore ibf 96 /dev/rmt/0  


Note - You must use the same blocking factor (or larger) when you retrieve or copy files from the tape to the hard disk as you did when you copied files from the hard disk to the tape. Therefore, you must specify the b option.

The system responds with a ufsrestore prompt. If you type a question mark, a list of available arguments is displayed:

  Available commands are:  
    ls [arg] - list directory  
    cd arg - change directory  
    pwd - print current directory  
    add [arg] - add 'arg' to list of files to be extracted  
    delete [arg] - delete 'arg' from list of files to be extracted  
    extract - extract requested files  
    setmodes - set modes of requested directories  
    quit - immediately exit program  
    what - list dump header information  
    verbose - toggle verbose flag (useful with "ls")  
    help or '?' - print this list  
  IF no 'arg' is supplied, the current directory is used  

You can now list the directories that are resident on the tape by typing ls.

  ufsrestore > ls  
  4lib/     dict        mail    openwin      spool  
  5bin      games       man/    preserve     src  
  adm       include/    net     pub          tmp  

You can now select the directories or files by using the add argument.

  ufsrestore > add man  

You can copy the man/ directory from the tape to the hard disk. An asterisk is displayed next to the man/ directory.

  ufsrestore > ls  
  4lib/     dict        mail    openwin      spool  
  5bin      games      *man/    preserve     src  
  adm       include/    net     pub          tmp  

Now you can extract or copy the files in the man/ directory onto the tape.

  ufsrestore > extract  

This completes the extraction or copying of the files in the man/ directory located on the tape.

tar Command

The tar command copies file systems or individual files from a hard disk to a tape (writing to tape) or from a tape to a hard disk (reading from tape). If you need more than one tape to back up files that are on your hard disk, use the cpio command or the ufsdump command. The tar command only supports single-volume interchange.
Example 1:
The following example explains how to copy files from a hard disk to a tape.

  example# tar cvbf 96 /dev/rmt/1 filename  

In this example, the tar command copies files to a tape drive with the device name or address of /dev/rmt/1.
  • The f option designates the device name or address of the source drive, which is the tape drive in this example.
  • The v option displays information about each file it copies.
  • The b option designates the blocking factor, which in this example is 96. This example has been optimized for a 5.0 Gbyte 4mm DDS device.
  • The c option creates the tarfile.
Example 2:
The next example explains how to copy files from a tape to the current working directory on a hard disk.

  example# tar xvbf 96 /dev/rmt/1  

In this example, the tar command copies files to the working directory located on the hard disk by using the x option.
  • The f option designates the device name or address of the destination drive, which are all the files on the tape cartridge in this example.
  • The v option displays information about each file it copies.
  • The b option designates the blocking factor, which in this example is 96. This example has been optimized for a 5.0 Gbyte 4mm DDS device.

Note - You must use the same blocking factor (or larger) when you retrieve or copy files from the tape to the hard disk as you did when you copied files from the hard disk to the tape.

iv>