SUMMARY: Reading Backup CoPilot Tape label?

From: Michael T. Kopp (mike.kopp@gtri.gatech.edu)
Date: Tue Sep 28 1993 - 10:25:11 CDT


A couple of weeks ago I posted the question of how can I read the Backup
CoPilot tape label from a shell script. I want to check to see if the
correct tape is in the drive and send a reminder notice to change the tape
if the wrong tape is loaded.

The only Backup CoPilot Utility that would allow me to read the tape label
is restore. If I start an interactive restore it will display the tape
label. It should be possible to wrtie a script to do this. However two
people sent me a simple script that uses dd to read the first block off of
the tape and then uses dd again the read the tape label from the block. In
limited testing it seeems to work well. Thanks to everyone who responded.
The script is called cklabel and it is included below.

#!/bin/sh
tape=${1:-${TAPE:-/dev/nrst8}}
mt -f ${tape} rewind && dd if=${tape} count=1 bs=63k 2>/dev/null |
                        dd ibs=1 skip=676 count=16 2>/dev/null ; echo ""
mt -f ${tape} rewind 2>/dev/null

-- 
Mike Kopp
Electronic Support Measures Laboratory
Georgia Tech Research Institute                mike.kopp@gtri.gatech.edu



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:18 CDT