From owner-freebsd-questions@FreeBSD.ORG Thu May 19 16:30:04 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6CCB816A4D1 for ; Thu, 19 May 2005 16:30:04 +0000 (GMT) Received: from zhonka1.zhonka.net (zhonka1.zhonka.net [66.228.195.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11B5F43D96 for ; Thu, 19 May 2005 16:30:04 +0000 (GMT) (envelope-from freebsd@philip.pjkh.com) Received: from wolf.pjkh.com ([66.228.196.74]) by zhonka1.zhonka.net (Post.Office MTA v3.5.3 release 223 ID# 0-58414U4500L450S0V35) with ESMTP id net; Thu, 19 May 2005 09:29:58 -0700 Received: from localhost (localhost [127.0.0.1]) by wolf.pjkh.com (Postfix) with ESMTP id 4B0B658C5; Thu, 19 May 2005 09:29:54 -0700 (PDT) Received: from wolf.pjkh.com ([127.0.0.1]) by localhost (wolf.pjkh.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 91352-05; Thu, 19 May 2005 09:29:54 -0700 (PDT) Received: by wolf.pjkh.com (Postfix, from userid 1000) id 142CF5823; Thu, 19 May 2005 09:29:54 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by wolf.pjkh.com (Postfix) with ESMTP id 0DDD955A6; Thu, 19 May 2005 09:29:54 -0700 (PDT) Date: Thu, 19 May 2005 09:29:54 -0700 (PDT) From: Philip Hallstrom To: Jonathan Belson In-Reply-To: <428CAB4B.6080907@witchspace.com> Message-ID: <20050519092749.G91441@wolf.pjkh.com> References: <428CAB4B.6080907@witchspace.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at pjkh.com cc: freebsd-questions@freebsd.org Subject: Re: Rewinding tapes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2005 16:30:04 -0000 > I've written a small script that backs up data to a tape, rewinds it, then > reads back the data that was stored as a test. > > The problem I've run into is that 'mt rewind' is asynchronous, and subsequent > tape operations will fail until the rewind operation has finished. > > Is there a way to find out when the tape has finished rewinding, or at least > to rewind synchronously? The drive is an ATA Seagate STT2401A. Can you use "mt status" along with the appropriate *.ctl device? >From the man page... Print status information about the tape unit. For SCSI mag- netic tape devices, the current operating modes of density, blocksize, and whether compression is enabled is reported. The current state of the driver (what it thinks that it is doing with the device) is reported. If the driver knows the relative position from BOT (in terms of filemarks and records), it prints that. Note that this information is not definitive (only BOT, End of Recorded Media, and hardware or SCSI logical block position (if the drive supports such) are considered definitive tape positions). Or maybe rdspos? Read SCSI logical block position. Some drives do not support this. The count argument is ignored. -philip