Tape drives and C programs

Tape drives and C programs

Post by Dan Millio » Wed, 19 Feb 2003 23:52:00

Greetings.  We have a StorageTek tape silo, and we use its
9840 tape drives connected to AIX hosts with fiberchannel.

We have a backup procedure which runs daily, and after a
tape gets mounted in a drive, a simple C program is invoked
to read the label on the tape.  The first thing it does is
open the tape device:

     fd = open(dev_name, O_RDONLY);

The problem is that this step quite frequently fails; fd
is returned as -1, and errno is EIO.  Based on everything
we can find, the tape is getting mounted correctly and no
other process is using the drive, so we can't figure out why
we get all these EIO errors when trying to open the device.

If anyone has had experience in this area and has any tips
or hints to share, I would appreciate it.