Linux tape backup basics howto

by Marion Bates <mbates at>

The 2.4 kernel has built-in SCSI support; you have to compile it in under 2.6 (legacy scsi support)


cat /proc/scsi/scsi
Look for a non-"Direct Access" device. ("Direct Access" devices are hard disks.) If it's not there (for example, because the drive was connected, but powered on after boot), get the rescan-scsi-bus script:

Run it:

Look for "NEW" and/or "sequential access"
cat /proc/scsi/scsi

again, and look for:

Host: scsi0 Channel: 00 Id: 05 Lun: 00
  Vendor: IBM      Model: ULTRIUM-TD1      Rev: 25D4
  Type:   Sequential-Access                ANSI SCSI revision: 03
Device name: Will have "s" in name because it's scsi
= non-rewindable scsi tape
= rewindable

x = number We want /dev/st0, the first rewindable scsi tape device.

To check drive status:

mt -f /dev/st0 status

To do mindless, one-time tar backup: The first three steps may be unnecessary, depending on drive model. Ours seems to automatically rewind and you can just let tar overwrite any existing data, rather than wait for the erase step to finish -- it takes a long time to erase the whole 100 GB.

mt -f /dev/st0 rewind
mt -f /dev/st0 erase
mt -f /dev/st0 rewind
mt -f /dev/st0 lock  #to prevent someone hitting eject before it's finished
tar -cvzf /dev/st0 /path/to/stuff/to/back/up/
mt -f /dev/st0 unlock
mt -f /dev/st0 eject


William Stearns, George Bakos.