From owner-freebsd-scsi Wed Nov 6 1:22:36 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 1C6C837B401 for ; Wed, 6 Nov 2002 01:22:34 -0800 (PST) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C6E543E7B for ; Wed, 6 Nov 2002 01:22:30 -0800 (PST) (envelope-from ru@whale.sunbay.crimea.ua) Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1]) by whale.sunbay.crimea.ua (8.12.6/8.12.6/Sunbay) with ESMTP id gA69MNRK096351 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 6 Nov 2002 11:22:23 +0200 (EET) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.12.6/8.12.6/Submit) id gA69MNlP096346; Wed, 6 Nov 2002 11:22:23 +0200 (EET) Date: Wed, 6 Nov 2002 11:22:23 +0200 From: Ruslan Ermilov To: Joerg Wunsch Cc: freebsd-scsi@freebsd.org Subject: Re: ``mt erase 0'' on a non-rewinded tape Message-ID: <20021106092223.GB93420@sunbay.com> References: <20021105122423.GA79188@sunbay.com> <200211051918.gA5JIqaY014094@uriah.heep.sax.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2fHTh5uZTiUOsy+g" Content-Disposition: inline In-Reply-To: <200211051918.gA5JIqaY014094@uriah.heep.sax.de> User-Agent: Mutt/1.4i 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 --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 05, 2002 at 08:18:52PM +0100, Joerg Wunsch wrote: > Ruslan Ermilov wrote: >=20 > > 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). >=20 > 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. >=20 OK, thanks for the explanation! > 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. >=20 My tapes always look like this: level 0 backups at Friday's evening, level 1 backups on Monday, ..., level 4 backups on Thursday. If I don't erase the tape when I do a level 0 backup, won't there be a chance that when I later do an incremental backup and do an "mt eom" it will find some stale file markers left by old incremental backups? > 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. >=20 I wasn't clear enough. I meant it worked if I always used the rewind device. In this case, "mt erase" was always run at the BOM. > 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. >=20 Yes, the script runs "mt eom" for that very reason. But why would I rewind the tape if the next day I want to use it from this same position? IOW, if the SCSI bus isn't reset in-between, I get: # /usr/bin/time mt eom 0,01 real 0,00 user 0,00 sys (I change the tapes once a week, at Friday's evening.) Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --2fHTh5uZTiUOsy+g Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE9yN9PUkv4P6juNwoRAhSRAJwL8ZIAFLXJb+jNwPHPmAEvkeo5JwCfYDbF 4FKNdX457wTgtGwI5nbrm8s= =tWQp -----END PGP SIGNATURE----- --2fHTh5uZTiUOsy+g-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message