Sequential-Access drives are different than Direct-Access drives and need to be treated as such. For a while now I had always thought differently because my experience with tape was only on OS X Server. And those machines had programs that managed the tape drives for ease of use.
With a little knowledge under my belt I know differently and now I’m passing it on:
The 2.4 kernel has built-in SCSI support so you may want to upgrade. I’m using SLES 9 and 10 so I was okay.
Test to see if you’ve got it hooked up correctly and if Linux notices it:
cat /proc/scsi/scsi
Look for a non-”Direct Access” device (“Direct Access” devices are hard disks), Tape drives are primarily “Sequential-Access” devices. If it’s not there (for example, because the drive was connected, but powered on after boot) recycle the system or find a rescan-scsi-bus script to run.
cat /proc/scsi/scsi brought up this for me:
Host: scsi1 Channel: 00 Id: 05 Lun: 00
Vendor: IBM Model: ULT3580-TD2 Rev: 53Y2
Type: Sequential-Access ANSI SCSI revision: 03
To check drive status:
mt -f /dev/st1 status
although yours might be:
mt -f /dev/st0 status
Now to use the tape drive you’ll need to use programs/commands that support non-direct-access drives. The easiest which I consider ideal is one-time tar backups: The first three steps may be unnecessary, depending on drive model. Mine 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 a 200 GB tape, trust me.
mt -f /dev/st1 rewind
mt -f /dev/st1 erase
mt -f /dev/st1 rewind
mt -f /dev/st1 lock #to prevent someone hitting eject before it's finished
tar -cvzf /dev/st1 /path/to/stuff/to/back/up/
mt -f /dev/st1 unlock
mt -f /dev/st1 eject
Bravo, Bros! keep going like this, more good info again.
This helped me so much! Thank you!
while taking backup using the command tar cvf /dev/st0 * ,a tar file is being created in /dev by the name of st0 and the data is not being copied into tape drive.Please provide the solution.
when I type mt -f /dev/st0 status
I get a answer permission denied
But my computer has my tape under sta st0 in the system.
How does it come or even what do I wrong.
Roger
[...] more here: Tape Drive Setup under Linux | Scattered Share this post to your [...]