Re: How to tell if a tape is loaded
2005-11-29 11:38:47
Jon LaBadie wrote:
On Tue, Nov 29, 2005 at 06:43:12AM -0800, Yan Seiner wrote:
I am using a VXA-1 tape drive.
I've been testing
mt -f /dev/nst0 load
which appears to work, returning 0 if the tape is loaded and 2 if it is
not....
On a request like this it would be good to know the
OS you are using as different OS's have different tools.
Doesn't everyone use what I use? :-) You're absolutely right..... Just
a very frustrating computer day.... This particular server is running
linux - Fedora Core 2.
I would consider mt "status" rather than "load".
You might even want to rewind before dumping.
The mt man pages on Solaris and SuSE say:
EXIT STATUS
0 All operations were successful.
1 Command was unrecognized or mt was unable to open the
specified tape drive.
2 An operation failed.
So nearly any mt action seems like a good choice.
OK, that's what my man page says too.... status returns
[root@tooth yan]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 1024 bytes. Density code 0x80 (DLT 15GB uncomp. or Ecrix).
Soft error count since last status=0
General status bits on (41010000):
BOT ONLINE IM_REP_EN
and after ejecting
[root@tooth yan]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=-1, block number=-1, partition=0.
Tape block size 0 bytes. Density code 0x0 (default).
Soft error count since last status=0
General status bits on (50000):
DR_OPEN IM_REP_EN
So it looks like I can get the tape status that way.... Status returns
a '0' even if the tape is not loaded, though.
I'm guessing that BOT is beginning of tape, ONLINE means the drive is
ready, and DR_OPEN is door open (no tape). IM_REP_EN - I have no clue.....
--Yan
|
|
|