Symptom :  Integrating a Tape Drive into a Linux System
 
Cause :  Integrating a Tape Drive into a Linux System
 
Resolution : 

This document provides information for integrating MammothTape, 8mm, 4mm, and Travan tape drives into a workstation running the Linux operating system. This information is intended for use with the installation and operation instructions that accompany your tape drive.

System requirements

To use a tape drive with a Linux workstation, you need to be running the Linux kernel version 2.0.x or above.

Modifying the kernel

Make sure the Linux kernel includes support for the following items:

  • SCSI
  • Your host adapter
  • SCSI tape drives

To enable support for the items above:

  1. Log in as "root" and change to the Linux kernel source directory:

    system:~# cd /linux		
    
  2. Start the configuration utility system:

    /linux# make config	
    
  3. In the configuration options, enable support for SCSI, your host adapter, and SCSI tape drives.

    Note: On some systems, you can run "make menuconfig," which offers menu-driven selection.
  4. Create the file dependencies:

    system:/linux# make dep
    
  5. Remove the old binaries:

    system:/linux# make clean
    
  6. Rebuild the kernel:

    system:/linux# make
    
  7. Make sure the kernel compiles successfully. If necessary, correct any problems.

  8. Create a bootable floppy disk with the new kernel. To do this, insert a formatted floppy disk in your A: drive, then enter:

    system:/linux# make zdisk
    
  9. Reboot with the new kernel from floppy disk. Check your system log files for any boot-time problems. If necessary, repeat the above steps.

  10. If there are no problems, install the new kernel onto the system boot disk.

Special considerations

This section describes special considerations for using Linux with your particular tape drive.

MammothTape drives (M2, Mammoth, and Mammoth-LT)

M2 is certified Linux compatible for backup. See integration tips from www.linuxtapecert.org.

8mm tape drives

EXB-8200 and EXB-8200SX

When integrating an EXB-8200 or EXB-8200SX into the Linux system, follow these guidelines:

  • Code level: We recommend MX code level 2618 for the EXB-8200 and 261A for the EXB-8200SX, with Servo code C034.

  • Busy conditions: If the tape drive does not rewind at the end of a tar command, even when the command specifies the rewinding tape device (/dev/st0), turn on the NBE bit (MX card switch 4). Some 2.0.x kernels do not handle a Busy condition correctly, causing the tape drive to return a Busy status on the REWIND command when it is flushing its buffer at the end of the tar save set.

  • SCSI bus holds: For some EXB-8200 firmware levels, the tape drive may hold the SCSI bus for a long time when doing error recovery. If this happens, Linux may experience problems when the system disk is on the same bus. In this case, you may want to purchase a separate SCSI card for your EXB-8200.

Adaptec 1542B with the 8505, 8505XL, 8205, 8205XL, 8700 product family, EXB-8500, or EXB-8500c

If you have an Adaptec AHA-1540/42B, microcode version V3.08, you may notice that the PROM on the Adaptec card causes timing problems. You should upgrade to a new PROM image, which is available from Adaptec's web site.

8mm density selection

All 8mm tape drives automatically switch to the density of the inserted tape (providing the tape is written in a format supported by the drive). Therefore, you do not need to manually set the tape density for read operations.

When you need to write a tape in a specific density, use the "mt setdensity" command. For example:

system:~# mt -f /dev/st0 setdensity 20

According to the man pages for "mt," you should be able to use hexadecimal notation for the density (for example, "0x8c" for 8500c format). However, several versions of the "mt" command contain a bug that causes the hexadecimal value to be interpreted as 0. Use the decimal numbers below instead.

8200 format , 0x14:

system:~# mt -f /dev/st0 setdensity 20
8500 format, 0x15:

system:~# mt -f /dev/st0 setdensity 21		
8500c format , 0x8c:

system:~# mt -f /dev/st0 setdensity 140		
8200c format , 0x90:

system:~# mt -f /dev/st0 setdensity 144		

Block size considerations

Linux can work with tape drives in either fixed or variable mode. By default, Linux uses the default block size of your tape drive. Internally, Linux uses a 32 KB work buffer. You can control block sizes by using the "mt setblk" command. For example:

Set to 2 KB blocks:

system:~# mt -f /dev/st0 setblk 2048
Set to variable mode:

system:~# mt -f /dev/st0 setblk 0
The following are application examples:

  • Write to a tape drive set for 1 KB fixed mode. Linux takes the data sent by the application, divides it up in 1 KB blocks and sends a single Write Fixed command, which specifies the number of 1 KB data blocks in the work buffer.
    Example: tar sends 10 KB blocks (512 byte * default blocking factor of 20) to the Linux tape driver. The tape driver collects as many blocks as fit in the internal 32 KB buffer; so in this case, 3 blocks of 10 KB=30 KB. The tape driver then sends a single Write Fixed command, which specifies 30 blocks to be transferred.

  • Write to a tape drive set for variable mode. Linux uses the block size as specified by the application and uses Write Variable commands to send these blocks one by one.
    Example: tar sends 10 KB blocks to the tape driver. The driver sends each block to the tape drive using a Write Variable command and specifying 10 KB data.

  • Read from a tape drive set for 1 KB fixed mode. When the tape driver receives a request to retrieve a specific logical block, it calculates how many fixed mode tape blocks to request.
    Example: tar asks for 10 KB blocks. The Linux tape driver knows the drive is in 1 KB mode, so it requests a single Read Fixed command of 10 blocks.

  • Read from a tape drive set for variable mode. The tape driver sends a Read Variable command, asking for the size of the internal buffer of 32 KB. If it receives Check Condition status with an Illegal Length Indicator, the driver calculates how much data it received and sends that to the application.
    Example: tar asks for 10 KB blocks. The tape driver sends a read variable of 32 KB. The drive returns a block of data and posts Check Condition status. The driver retrieves the sense information and calculates that it received 10 KB of data. It passes those 10 KB on to the application.

You may want to exchange data between Linux and other Unix platforms (Solaris, AIX, SINIX, SCO, and so on). Most of the problems come from those platforms using a different block size. You may receive a "Tape I/O error" when trying to read those tapes, especially if your tape drive is set for 1 KB blocks and the tape contains 512-byte blocks. To solve this problem, use one of the following solutions:

  • If you know the block size on tape, use "mt setblk x" where x is the correct block size. This gives you the best performance.

  • If you do not know the block size on tape, use "mt setblk 0" to set the drive to variable mode. This gives you lower performance (only 1 block is transferred for each SCSI command, plus Check Condition overhead), but works most of the time.

4mm tape drives

If you have an EXB-4200c with firmware version V217 and the tape drive is attached to a Future Domain controller, you may sometimes notice hang conditions. Upgrade your tape drive to the latest firmware level. You can download new firmware from this web site.

For the EXB-4200c with firmware version V136f and higher, you can switch between compressed and non-compressed modes with the "mt setdensity" command. For example:

Compressed format, 0x43:

 system:~# mt -f /dev/st0 setdensity 67
Uncompessed format, 0x63:

system:~# mt -f /dev/st0 setdensity 99		



Minicartridge tape drives

EXB-2501 and EXB-2501c

Make sure your EXB-2501 has firmware version 20 or higher.

The EXB-2501 and EXB-2501c only work in fixed mode, either 512-byte or 1 KB mode.

EXB-1500, Eagle 96, and Eagle TR-3

Linux requires a driver called "Ftape" to support floppy-based QIC drives, such as the EXB-1500, Eagle 96, and Eagle TR-3. Download Ftape, making sure you receive the latest version of the Ftape driver (2.11a or higher). Follow the installation instructions carefully. If you have an Eagle tape drive with the non-plug-and-play accelerator card, look at the main Ftape makefile. In this makefile, there is a definition for the accelerator card, with its I/O address, IRQ, and DMA settings. By default, the definition is commented out. Remove the comment and make sure the settings correspond with your card. When finished, compile the Ftape package.

You may need to review your kernel to see if it includes support for floppy-based QIC products. If it does not, run "make config" in your Linux source directory, select QIC-80 tape support, and rebuild the kernel.

Eagle TR-4i

You can use the Eagle TR-4i with Linux by including support for IDE tape drives in the Linux kernel. To do this, run "make config" in your Linux kernel source directory, enable IDE tape support, and rebuild the kernel. The current driver is not specifically written to support the Eagle TR-4i, and will issue a couple of warnings on boot-up. However, operation with packages like tar work very well. Backup speeds of 25 to 30 MB/min are not unusual.

Enspire NS8

The Enspire NS8 works in 512-byte, fixed mode only.
 






Help us improve!
Did this document help in solving your issue?  Yes No

Feedback: