Discussion Locked

Check drive for tapes

0 helpful
14 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
We have scsi exabyte drives connected to our SCO boxes. We have had problems with getting the tapes into the drives in a timely manner because they are at another location. Is there a way to check the drive to see if a tape has been inserted? We can do it with Solaris, but haven't found anything for SCO.

14 replies

by skizz

I'm not a SCO expert, but running the file command against the /dev entry for the tape device will often provide useful info on some Unix platforms.

by john h.

File command doesn't tell me if there is a tape in the drive or not. Does give other useful info though.

by skizz

Do you have tctl or mt commands, sending an mt rewind to the tape drive will either work, or give you an error if no tape is loaded....

by john h.

tctl is not available and the mt command does not work. On our Solaris boxes, we can use mt with the status command to check the drive, but need something for our SCO boxes.

by cpfeiffe

I'm not familiar with SCO either, just Solaris, HP and AIX. If you have mt available that would be good to use, but you probably don't want to rewind the tape (if you plan to store more than one image on a tape the rewind command will put it back to the beginning and your next write will overwrite what was on the tape). Try this syntax -- mt -f /dev/rmt/0n status, assuming /dev/rmt/0 is the location of your tape. The n is for no rewind and status gives you a simple three line status of the tape. If there is no tape then you will get an error when you run this command instead of a three line status output.

Good luck.

by john h.

I tried mt with the status command and it didn't work. Status is not available on our SCO boxes.

by cavedweller

On SCO systems the "tape" command replaces "mt". I use "tape status" in scripts and grep the output (silently) to check tape status. A while loop is good for this if you need to wait until a tape is loaded.

by burra

I believe the following script should work.

echo"Tape testing going on"
tar tv >/dev/null 2>&1
echo $? >tmp
a=`cut -c1-2 tmp`
if [ $a = 0 ]
then
echo "Tape is inserted"
else
clear
echo "No tape please "
fi

The "tar tv" can be replaced by "mt rew" also which will yield the same result. We can expand this script by writing the out put of the script to mail automatically for the Admin.

This discussion is closed to new replies.