Operating System - HP-UX
1833868 Members
1690 Online
110063 Solutions
New Discussion

Tape Device Manipulation hmmm....

 
SOLVED
Go to solution
Charles Harris
Super Advisor

Tape Device Manipulation hmmm....

 
6 REPLIES 6
Charles Harris
Super Advisor

Re: Tape Device Manipulation hmmm....

Sorry, this post wasn't supposed to be a guess the question....

Does anyone know of a command similar to the AIX tctl status to give an indication of wether a tape is present in a drive?
or another method of determining tape drive status?

Any comments / tips / advice always appreciated!!!

cheers,

-ChaZ-
Robin Wakefield
Honored Contributor
Solution

Re: Tape Device Manipulation hmmm....

Charles,

Try rewinding the tape, and check the return status:

mt -t {devicename} rew

I'm assuming it doesn't matter if the tape IS rewound.

Rgds, Robin.
A. Clay Stephenson
Acclaimed Contributor

Re: Tape Device Manipulation hmmm....

Hi Charles:

How about something as simple as this:

dd if=/dev/rmt0 bs=512 count=0 > /dev/null 2>&1
STAT=$?
if [ ${STAT} -eq 0 ]
then
"Tape in"
else
"BAD"
fi
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Tape Device Manipulation hmmm....

Hi CHarles:

Take a look at 'mt'. You might try:

# mt status

...JRF...
Charles Harris
Super Advisor

Re: Tape Device Manipulation hmmm....

Good call, I was going to claim that it was Monday, but it's obviously not, I think I'm loosing the plot!
The exit status simple yet effective, thanks!

-ChaZ-
Angus Crome
Honored Contributor

Re: Tape Device Manipulation hmmm....

Take a look at the st command as well;
st -f -s should give you a status.

It may be released with Omniback though, I'm not sure if it comes standard in HP-UX.
There are 10 types of people in the world, those who understand binary and those who don't - Author Unknown