Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Nov 2002 20:18:52 +0100 (MET)
From:      j@uriah.heep.sax.de (Joerg Wunsch)
To:        freebsd-scsi@freebsd.org
Cc:        Ruslan Ermilov <ru@freebsd.org>
Subject:   Re: ``mt erase 0'' on a non-rewinded tape
Message-ID:  <200211051918.gA5JIqaY014094@uriah.heep.sax.de>
References:  <20021105122423.GA79188@sunbay.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Ruslan Ermilov <ru@FreeBSD.ORG> wrote:

> 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).

Please read the SCSI command description for your drive.  Depending on
the media type, the ERASE command will only be accepted at either
beginning of medium, or at the beginning of partition for a
partitioned medium.  AFAICT, the FreeBSD driver doesn't support
partitions anyway, so in effect, the drive will only accept the
command at BOM.

Apart from that, i don't understand your reasoning for the erase
command.  Since the quick erase is a logical erase command only
anyway, the effect is the same like starting to write from BOT, for
any practical purpose.

Whether you use the rewind or non-rewind device should make no
difference, as long as the tape itself is at BOM.  "non-rewind"
actually means "do not rewind upon close of the device", while the
state at open time is always the state the device has been left over
by the last operation.

It's always good practice to keep the medium at BOM while the tape is
not in use, since after all, that's the only position you can rely of.
Otherwise, if a SCSI bus reset hit while your script was idle, the
drive will rewind the tape, and next time your script is run it might
make an invalid assumption about the actual tape position, thus
perhaps accidentally overwriting something.  OK, you wrote that you're
using a "mt eom" before trying to append, so you're already safe
there, but then there's no reason to not rewind the medium when
finishing the script.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211051918.gA5JIqaY014094>