1755680 Members
5432 Online
108837 Solutions
New Discussion юеВ

Tape Question

 
SOLVED
Go to solution
Robert Fisher_1
Frequent Advisor

Tape Question

Hi guys,

I have a very simple question. How can I tell if a tape is in the drive?

Thanks,
Bob
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Tape Question


mt -f /dev/rmt/0m rew
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then
echo "Tape is mounted"
else
echo "No tape; status ${STAT}"
fi
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Tape Question

Hi Robert:

# mt -t /dev/rmt/0mnb rew

...for instance...

...will fail if no tape is present.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Tape Question

Oh, and I should add if you want to avoid any pesky error messages coming to your terminal then redirect stderr:

mt -f /dev/rmt/0m rew 2>/dev/null
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: Tape Question

Shalom Bob,

Of course any mt command is fine.

Why not try this:

tar cvf /dev/rmt/0m /etc/issue

Of course this can be messed up by the write tab on the table.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
OldSchool
Honored Contributor

Re: Tape Question

just stay away from "offl" in the mt command.

rewinds / ejects tape (on DLT unloads tape and set "Operate handle" light) which would leave the tape drive unusable until tape is removed and reinserted.
Pupil_1
Trusted Contributor

Re: Tape Question

mt -f /dev/rmt/xmn status
will give you the availability of the tape !!

# mt -f /dev/rmt/0mn status
Drive: HP C1537A
Format:
Status: [0]
File: 2
Block: -1
#

Means that the tape is missing !!

#mt -f /dev/rmt/0mn status
Drive: HP C1537A
Format: DDS-3 format
Status: [41112500] BOT online compression immediate-report-mode
File: 0
Block: 0
#

Means that the drive has a DDS3 tape inside !!

There is always something new to learn everyday !!
V.Manoharan
Valued Contributor

Re: Tape Question

Hi Robert,
simple mt(magnetic tape control) command will do most of the tape releated operation like tape movement,eject,rewind etc. for more info see the man page.

mt -f /dev/rmt/0mn status -->will show whether tape is present or not.

thanks and regards
V.Manoharan