From owner-freebsd-questions Wed Oct 30 13:26: 6 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 41D5B37B401 for ; Wed, 30 Oct 2002 13:26:05 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8533C43E6E for ; Wed, 30 Oct 2002 13:26:04 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.6) id g9ULQ3Ni089171; Wed, 30 Oct 2002 15:26:03 -0600 (CST) (envelope-from dan) Date: Wed, 30 Oct 2002 15:26:03 -0600 From: Dan Nelson To: Matthias Trevarthan Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Sony AIT tape position question Message-ID: <20021030212603.GD42580@dan.emsphone.com> References: <200210301441.55643.trevarthan@wingnet.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200210301441.55643.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 (Oct 30), Matthias 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. 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. > (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. > 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. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message