What is the output on AIX then? It may depend perhaps on mt package or package having mt included. You could check AIX forum for that. I know I have seen on some HPUX platforms too having mt package without support for status command, but that has been resolved by box admin installing different version of mt command.
If you do mt -f device rewind I would assume that - if tape is inside it will get rewinded and exit code will be 0 - if tape is not inside you will get an error and exit code other than 0
Use that. I find strange that there is NO difference in status output if tape is loaded and if that is not loaded in specific drive. Are you sure that is the case?
What error message? That there is no tape inside? Perfect, then you can eliminate that logical path for used physical drive, right? ...or there is something else going on?
mt command on Solaris, Windows ... shows if there is a mounted tape:
C:\>mt -f \\.\Tape0 status \\.\Tape0: Current Status: The media in the drive may have changed.
default blocksize = 8192 maximum blocksize = 131072 minimum blocksize = 1 MaximumPartitionCount = 1 EOTWarningZoneSize = 0 CompressionEnabled Features: Performs LONG erase operation Performs IMMEDIATE erase operation Support FIXED block length mode Support VARIABLE block length mode Returns errors on write if tape is write - protected Supports hardware data compression Can provide current absolute device block address Can provide current logical block address and partition Can physically load and / or unload tape Support PREVENT / ALLOW Media Removal Performs IMMEDIATE rewind operations Allows Setting FIXED LENGTH or VARIABLE block sizes Performs IMMEDIATE Load / Unload operations Allows hardware data compression to be enabled / disabled Can position tape to an absolute physical block Can position tape to a logical block(and partition) Can position tape to END of RECORDED DATA Can perform tape record positioning(backwards / forwards) Can perform tape file positioning(backwards / forwards) Can search for sequential filemarks Can move backwards across records or filemarks or setmarks Can write FILEMARKS Performs IMMEDIATE tape mark write operations operation status on \\.\Tape0 failed: No media in drive.
In AIX, shows:
# mt -f /dev/rmt1.1 status mode yes Use DEVICE BUFFERS during writes True block_size 0 BLOCK size (0=variable length) True extfm yes Use EXTENDED file marks True res_support yes RESERVE/RELEASE support True var_block_size 0 BLOCK SIZE for variable length support True density_set_1 0 DENSITY setting #1 True density_set_2 0 DENSITY setting #2 True delay 45 Set delay after a FAILED command True rwtimeout 144 Set timeout for the READ or WRITE command True
which is similar to:
#lsattr -El rmt1 mode yes Use DEVICE BUFFERS during writes True block_size 0 BLOCK size (0=variable length) True extfm yes Use EXTENDED file marks True res_support no RESERVE/RELEASE support True var_block_size 0 BLOCK SIZE for variable length support True density_set_1 0 DENSITY setting #1 True density_set_2 0 DENSITY setting #2 True delay 45 Set delay after a FAILED command True rwtimeout 144 Set timeout for the READ or WRITE command True
We needed to know how to obtain on AIX the same output that on Windows¿
Well, if you get an error message no matter what status of drive is you might have some other issue to deal with. Not knowing error message won't help so I would sugget to check it out and involve IBM support too.
ble1
4 Operator
•
14.4K Posts
0
August 28th, 2006 07:00
ble1
4 Operator
•
14.4K Posts
0
August 28th, 2006 08:00
- if tape is inside it will get rewinded and exit code will be 0
- if tape is not inside you will get an error and exit code other than 0
Use that. I find strange that there is NO difference in status output if tape is loaded and if that is not loaded in specific drive. Are you sure that is the case?
ble1
4 Operator
•
14.4K Posts
0
August 28th, 2006 08:00
ble1
4 Operator
•
14.4K Posts
0
August 28th, 2006 08:00
To check if tape is mounted on in drive you could always use sjirdtag command to verify it.
smora1
253 Posts
0
August 28th, 2006 08:00
C:\>mt -f \\.\Tape0 status
\\.\Tape0:
Current Status: The media in the drive may have changed.
default blocksize = 8192
maximum blocksize = 131072
minimum blocksize = 1
MaximumPartitionCount = 1
EOTWarningZoneSize = 0
CompressionEnabled
Features:
Performs LONG erase operation
Performs IMMEDIATE erase operation
Support FIXED block length mode
Support VARIABLE block length mode
Returns errors on write if tape is write - protected
Supports hardware data compression
Can provide current absolute device block address
Can provide current logical block address and partition
Can physically load and / or unload tape
Support PREVENT / ALLOW Media Removal
Performs IMMEDIATE rewind operations
Allows Setting FIXED LENGTH or VARIABLE block sizes
Performs IMMEDIATE Load / Unload operations
Allows hardware data compression to be enabled / disabled
Can position tape to an absolute physical block
Can position tape to a logical block(and partition)
Can position tape to END of RECORDED DATA
Can perform tape record positioning(backwards / forwards)
Can perform tape file positioning(backwards / forwards)
Can search for sequential filemarks
Can move backwards across records or filemarks or setmarks
Can write FILEMARKS
Performs IMMEDIATE tape mark write operations
operation status on \\.\Tape0 failed: No media in drive.
In AIX, shows:
# mt -f /dev/rmt1.1 status
mode yes Use DEVICE BUFFERS during writes True
block_size 0 BLOCK size (0=variable length) True
extfm yes Use EXTENDED file marks True
res_support yes RESERVE/RELEASE support True
var_block_size 0 BLOCK SIZE for variable length support True
density_set_1 0 DENSITY setting #1 True
density_set_2 0 DENSITY setting #2 True
delay 45 Set delay after a FAILED command True
rwtimeout 144 Set timeout for the READ or WRITE command True
which is similar to:
#lsattr -El rmt1
mode yes Use DEVICE BUFFERS during writes True
block_size 0 BLOCK size (0=variable length) True
extfm yes Use EXTENDED file marks True
res_support no RESERVE/RELEASE support True
var_block_size 0 BLOCK SIZE for variable length support True
density_set_1 0 DENSITY setting #1 True
density_set_2 0 DENSITY setting #2 True
delay 45 Set delay after a FAILED command True
rwtimeout 144 Set timeout for the READ or WRITE command True
We needed to know how to obtain on AIX the same output that on Windows¿
Thanks
smora1
253 Posts
0
August 28th, 2006 08:00
Thanks
smora1
253 Posts
0
August 28th, 2006 08:00
mt -f device rewind likes not work fine. It always shows the same error message after many minutes.
Thanks
ble1
4 Operator
•
14.4K Posts
0
August 28th, 2006 09:00
smora1
253 Posts
0
August 28th, 2006 09:00
Thanks