atom feed4 messages in org.freebsd.freebsd-scsi``mt erase 0'' on a non-rewinded tape
FromSent OnAttachments
Ruslan ErmilovNov 5, 2002 4:24 am 
Joerg WunschNov 5, 2002 11:18 am 
Ruslan ErmilovNov 6, 2002 1:22 am 
Joerg WunschNov 6, 2002 1:57 am 
Subject:``mt erase 0'' on a non-rewinded tape
From:Ruslan Ermilov (ru@FreeBSD.org)
Date:Nov 5, 2002 4:24:01 am
List:org.freebsd.freebsd-scsi

Hi there!

I have a script that does automated file system backups using mt(1) and dump(8). My tape drive is:

sa0: <TANDBERG SLR100 0402> Removable Sequential Access SCSI-2 device)

When doing a level 0 backup, the script does a quick erase of the tape, then does the retension, then does the backup. When doing an incremental backup, it seeks to the end of recorded medium, then does the backup. The script works with the no-rewind device, /dev/nsa0.

The script always used to fail with EINVAL attempting to run a quick erase, ``mt erase 0''. After a bit of experimenting, it turned out that `erase' only works if I rewind the tape (either through by using the rewind device, or by running the `rewind' or `retension' commands in advance).

Here is my question. Is this always the case that MTERASE only works with a rewinded tape, or is this device-dependent? If the former, what would be an appropriate way to document it? (I am reluctant to find myself where this EINVAL is coming from, and there is a plenty of them under sys/cam/.)

Cheers,

http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age