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

next in thread | previous in thread | raw e-mail | index | archive | help
Well, it's been a while since this was posted, but=20
I'm just getting a chance to re-investigate the=20
possibility of determining my Sony AIT tape=20
drive's wound position. It would be extremely=20
convenient to read via the command line in my=20
backup scripts, and for remote administration.

See replies listed below:


On Wednesday 30 October 2002 16:26, Dan Nelson=20
wrote:
> In the last episode (Oct 30), Matthias=20
Trevarthan said:
> > I have a Sony AIT tape drive (one of the
> > nifty 4 tape autoloaders): TSL-SA300C.  It
> > has a nice little display on the front that
> > indicates the tape's "wound" status. When the
> > tape is fully rewound, the bar graph is full.
> > When the tape is fully recorded, or wound,
> > the bar graph is empty.
> >
> > Is there any way that I can detect this
> > programmatically? I would like my scripts to
> > be intelligent enough that they can
> > approximate the size required for a dump, and
> > the size left on the tape.
>
> That's difficult.  There definitely isn't any
> standard SCSI command for pulling this info.=20
> Sony might provide it in a vendor-specific
> modepage (readable with the "camcontrol
> modepage" command; you can decode
> vendor-specific pages by adding entries to
> /usr/share/misc/scsi_modes). See if you can
> find a technical manual for the AIT drive.

Hmmm.... executed this:

--------------
camcontrol devlist
--------------

and got this:

--------------
<SONY TSL-A300C L107>              at scbus1=20
target 5 lun 0 (pass0,sa0)
<SONY TSL-A300C L107>              at scbus1=20
target 5 lun 1 (pass1,ch0)
--------------

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
--------------

I couldn't get modepage output if I requested more=20
than or fewer than 2 pages.

How do I use this output? What is it? I'm not=20
familiar with low level SCSI, or FreeBSD Cam. But=20
if you can give me some on-line references, I'd=20
be happy to educate myself. (story of my life!)

>
> > (I would also like to detect which tape I
> > have loaded at any given point, but I suspect
> > that is outside the bounds of standard SCSI
> > communication. I'd probably need some
> > proprietary code to do this...)
>
> If your autoloader has a barcode scanner, you
> can read the labels with the "chio status"
> command.

Once I installed the 'ch' driver in the kernel,=20
'chio' works great. I can now determine which=20
tape is loaded, and swap tapes from the command=20
line. Cool stuff.

Thanks!

>
> > 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=20
rdspos and rdhpos outputs, but since my drive=20
uses variable block size, I'm afraid it's=20
hopeless.... It gives me a number, but I can't=20
make any sense of it. I've tried multiplying by=20
1024, 512, 2048, 256, 128, etc... but nothing=20
comes up with a number close to what the drive's=20
LCD "wound" indicator displays.

Thanks.

I hope you can point me in the right direction for=20
the modepage thing.

Matthias


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?200211261700.46508.trevarthan>