Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 May 2005 09:29:54 -0700 (PDT)
From:      Philip Hallstrom <freebsd@philip.pjkh.com>
To:        Jonathan Belson <jon@witchspace.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Rewinding tapes
Message-ID:  <20050519092749.G91441@wolf.pjkh.com>
In-Reply-To: <428CAB4B.6080907@witchspace.com>
References:  <428CAB4B.6080907@witchspace.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



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