General
cancel
Showing results for 
Search instead for 
Did you mean: 

open on tape device file failing with error "No such device or address"

SOLVED
Go to solution
Navecric
Occasional Advisor

open on tape device file failing with error "No such device or address"

Hi all,

I have a tape library with tape drives and there is no volume loaded in any of these drives. When I issue a open command on one of the device file of a tape drive , I'm getting an error saying "No such device or address".

And the mt output says that "the tape media is not present"
Drive: IBM ULTRIUM-TD3
Format:
Status: Tape media is not present
File: 0
Block: 0

But, "ioscan -funC tape" is listing the device file and corresponding tape drive information

tape 75 ******* stape CLAIMED DEVICE IBM ULTRIUM-TD3
/dev/rmt/75m /dev/rmt/75mn /dev/rmt/c13t3d3BEST /dev/rmt/c13t3d3BESTn
/dev/rmt/75mb /dev/rmt/75mnb /dev/rmt/c13t3d3BESTb /dev/rmt/c13t3d3BESTnb

And When I load a volume in to one of the tape drives and issue a open command, its working fine and i could use any ioctl on that tape device.

So, Is it like we can do an open on a tape device file only when a volume is loaded in the tape drive. And also how is iostat giving us the information even when there is no volume loaded in the tape drive .

Can someone please help me on this

Thanks,
Naveen
6 REPLIES
R.O.
Esteemed Contributor

Re: open on tape device file failing with error "No such device or address"

Hi,

It is the expected behaviour. If I try to rewind a tape, and the tape is unloaded, I get:

HP:/root#mt rew
/dev/rmt/0mnb: No such device or address


Regards,
"When you look into an abyss, the abyss also looks into you"
Navecric
Occasional Advisor

Re: open on tape device file failing with error "No such device or address"

Hi,

Thanks for the reply. But, How does ioscan able to give me the device class , driver, vendor, product names even though the tape is not loaded.

Is it using an ioctl call to get the above required information. If not can you let me know the C functions its using to get the required information on HPUX.

Thanks,
Naveen.
R.O.
Esteemed Contributor
Solution

Re: open on tape device file failing with error "No such device or address"

Hi,


From man ioscan:
" ioscan scans system hardware, usable I/O system devices, or kernel I/O system data structures as appropriate, and lists the results. For each hardware module on the system, ioscan displays by default the hardware path to the hardware module, the class of the hardware module, and a brief description."

There is no need that tape is mounted when perform an ioscan. I'm afraid I can't help you about the "C functions"

Regards,
"When you look into an abyss, the abyss also looks into you"
Laurent Menase
Honored Contributor

Re: open on tape device file failing with error "No such device or address"

you can use scsi_ctl (man 7 scsi_ctl)
and issue a REQUEST SENSE scsi command

it will answer if a tape is present, its format and position
http://www-01.ibm.com/support/docview.wss?uid=ssg1S7001045&aid=1
will give you sens format answer ( page 113)
Torsten.
Acclaimed Contributor

Re: open on tape device file failing with error "No such device or address"

>> But, How does ioscan able to give me the device class , driver, vendor, product names even though the tape is not loaded.


This is read from the tape drive itself, for any tape related operation a tape must be loaded. Sounds obvious.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Navecric
Occasional Advisor

Re: open on tape device file failing with error "No such device or address"

I'm able to use libIO library APIs (which ioscan uses) to get the information the same way ioscan displays. Even though I haven't loaded the tape, I'm able to get all the information like the Device name, Vendor name, Device type etc .. using the libIO C functions.