From owner-freebsd-scsi Tue Nov 5 11:20:14 2002 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 81A2837B477; Tue, 5 Nov 2002 11:20:09 -0800 (PST) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC67743E6E; Tue, 5 Nov 2002 11:20:06 -0800 (PST) (envelope-from j@uriah.heep.sax.de) Received: (from uucp@localhost) by sax.sax.de (8.9.3/8.9.3) with UUCP id UAA01499; Tue, 5 Nov 2002 20:20:04 +0100 (CET) Received: from uriah.heep.sax.de (localhost.heep.sax.de [127.0.0.1]) by uriah.heep.sax.de (8.12.5/8.12.5) with ESMTP id gA5JIqWc014095; Tue, 5 Nov 2002 20:18:52 +0100 (MET) (envelope-from j@uriah.heep.sax.de) Received: (from j@localhost) by uriah.heep.sax.de (8.12.5/8.12.5/Submit) id gA5JIqaY014094; Tue, 5 Nov 2002 20:18:52 +0100 (MET) (envelope-from j) Date: Tue, 5 Nov 2002 20:18:52 +0100 (MET) Message-Id: <200211051918.gA5JIqaY014094@uriah.heep.sax.de> Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) Organization: Private BSD site, Dresden X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E References: <20021105122423.GA79188@sunbay.com> From: j@uriah.heep.sax.de (Joerg Wunsch) Subject: Re: ``mt erase 0'' on a non-rewinded tape X-Original-Newsgroups: local.freebsd.scsi To: freebsd-scsi@freebsd.org Cc: Ruslan Ermilov Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Ruslan Ermilov 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