How to use the DAT-tape with Linux

This document describes how to use the DAT-tape standing besides Gettysburg with the Linux machine cs-zz12. It asumes some familiarity with Linux or other UNIX-systems. It is itentionaly kept short, so that you can find the important information quickly. If you are in a hurry, check the typical sessions section.

Tape organisation

The tape is structured in multiple files which are in a sequential order. The individual files are usually tar-archives. You can always append new files (tar-archives) to the tape (if there is enough space left).

Handling the tape

Insert the tape softly with the arrow on the upper side, pointing in the direction of the drive.

It will then be sucked in automatically. Ejecting the tape is done with the mt-command (see below).

Important: Before the first "mt" or "tar" command, you must switch the SCSI Switch to "1". Otherwise the system will fail to recognize the SCSI devices (including the tape drive).

Tape operation

You can operate the tape with the command "mt" (magnetic tape). You use it like this: "mt -f /dev/nst0 command". For more detailed information, see the man page. Examples are given below. The most important commands are:

Examples for the mt-command

Transfering data to and from the tape

You usually do this with the "tar" command. "Tar" always needs the parameter "-f" with the corresponding device, in this case "/dev/nst0". The parameter "-v" (verbose) is also suggested. The other parameters you usually need are:

Examples for tar-command

Typical sessions

Backup / Store

  1. Insert tape in tape drive and probably switch SCSI Switch to one.
  2. Check status of tape: mt -f /dev/nst0 stat
  3. Probably go to end of tape: mt -f /dev/nst0 eom
  4. Store <stuff> on tape: tar -cvf /dev/nst0 <stuff>
  5. Rewind and eject tape: mt -f /dev/nst0 offline


  1. Insert tape in tape drive and probably switch SCSI Switch to one.
  2. Check status of tape: mt -f /dev/nst0 stat
  3. Go to the directory where you want to restore your file(s).
  4. Go to the right file on the tape with the following commands:
  5. Extract your file(s): tar -xvf /dev/nst0 [<files>]
  6. Rewind and eject tape: mt -f /dev/nst0 offline

Remote operation

If your tape drive is in another machine than the machine you want to backup from, you can use the same tar-commands as described above with one little change: Login to the machine where the data is and instead of the tar-archive filename /dev/nst0, you specify hostname:/dev/nst0 (where hostname is the name of the machine where the tape-drive is). If you need to be another user on the machine with the drive to access the tape, you can even use the filename user@hostname:/dev/nst0.

The mt command must still be executed on the machine where the tape drive is. There is no remot-mt as far as I know.

Last change: 21 February 2001