From owner-freebsd-questions Tue Nov 26 14:30:50 2002 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 A540837B401 for ; Tue, 26 Nov 2002 14:30:48 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 158D743EA9 for ; Tue, 26 Nov 2002 14:30:48 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.6) id gAQMUlLx000129; Tue, 26 Nov 2002 16:30:47 -0600 (CST) (envelope-from dan) Date: Tue, 26 Nov 2002 16:30:47 -0600 From: Dan Nelson To: Matthias Trevarthan Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Sony AIT tape position question Message-ID: <20021126223047.GB32468@dan.emsphone.com> References: <200210301441.55643.trevarthan@wingnet.net> <20021030212603.GD42580@dan.emsphone.com> <200211261700.46508.trevarthan@wingnet.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200211261700.46508.trevarthan@wingnet.net> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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