Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Nov 2002 16:30:47 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Matthias Trevarthan <trevarthan@wingnet.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Sony AIT tape position question
Message-ID:  <20021126223047.GB32468@dan.emsphone.com>
In-Reply-To: <200211261700.46508.trevarthan@wingnet.net>
References:  <200210301441.55643.trevarthan@wingnet.net> <20021030212603.GD42580@dan.emsphone.com> <200211261700.46508.trevarthan@wingnet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Nov 26), Matthias Trevarthan said:
> Well, it's been a while since this was posted, but I'm just getting a
> chance to re-investigate the possibility of determining my Sony AIT
> tape drive's wound position. It would be extremely convenient to read
> via the command line in my backup scripts, and for remote
> administration.
> 
> Then, I used that information to execute this:
> 
> camcontrol modepage 1:5:0 -m 2
> 
> and got this for output:
> 
> Buffer Full Ratio:  0
> Buffer Empty Ratio:  0
> Bus Inactivity Limit:  0
> Disconnect Time Limit:  0
> Connect Time Limit:  0
> Maximum Burst Size:  1566
> DTDC:  0

Ok, that's modepage 2, which is the Disconnect-Reconnect page and
doesn't have any potitional status information anyway.  None of the
standard pages do, so you'll need to look at the SCSI spec document for
the AIT drives.  It's doubtful that one exists; modepages don't seem to
store ephemeral information like tape position.  They're usually used
more for configuration, like enabling retires on error, or adjusting
the streaming buffer sizes.

> > > When I use the 'mt' command with 'rdspos' I get a block number.
> > > Would this number be useful in determining how wound the tape is?
> > > If so, how would I go about interpreting this as a percentage or
> > > as a byte volume?
> >
> > rdspos gives you the logical scsi block number, which doesn't mean
> > much if your tape does hardware compression, since a tape full of
> > zeros will have more logical blocks on it than a tape full of zip
> > files.  rdhpos might work better, if the tape drive actually ends
> > up writing fixed-size blocks to tape.
> 
> I've tried to figure out a rhyme or reason to the rdspos and rdhpos
> outputs, but since my drive uses variable block size, I'm afraid it's
> hopeless.... It gives me a number, but I can't make any sense of it.
> I've tried multiplying by 1024, 512, 2048, 256, 128, etc... but
> nothing comes up with a number close to what the drive's LCD "wound"
> indicator displays.

Try generating 1gb of random data, run a "dd if=randomdata
of=/dev/nrsa0 bs=1m ; mt rdhpos" loop until the tape fills up, and then
graph the results.  If it's a straight line, you can safely use the
results of rdhpos as a rough tape capacity indicator.  If you were not
writing completely random data, chances are your tape drive's
compresion algorithm was screwing up your calculations.

-- 
	Dan Nelson
	dnelson@allantgroup.com

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




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