Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.unix.aix Frequently Asked Questions (Part 2 of 5)
Section - 1.206: Resetting a hung tape drive

( Part1 - Part2 - Part3 - Part4 - Part5 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Business Photos and Profiles ]


Top Document: comp.unix.aix Frequently Asked Questions (Part 2 of 5)
Previous Document: 1.205: What is tape block size of 0?
Next Document: 1.207: How do I restore specific files from a mksysb tape?
See reader questions & answers on this topic! - Help others by sharing your knowledge

A process accesses the tape drive. The process stops, exits, or whatever,
but still hold on to the drive. When this happens, the process cannot be
killed by any signal and the tape drive cannot be used by any other
process until the machine is rebooted.

The following should help:

RESET:

AIX, like most UNIX systems has no reset function for tape drives. You
can however send a Bus Device Reset (a standard SCSI message) to the
tape drive using the following piece of code. If the tape drive does
not respond to the BDR, then a SCSI Bus Reset will be sent (and this
will reset every device on the SCSI Bus). SCSI Bus resets are rather
extreme so you should refrain from using this program unnecessarily. 
But there are times (like after you've inserted a jammed/old/bad tape in
an 8mm drive), when there's no other way to reset the device other than
to shutdown and reboot (obviously you can power down and up an external
drive to reset it - and this would be the better choice).

This is actually documented in info, but can be hard to find and
there's no complete program.

/* taperst: resets the tape drive by sending a BDR to the drive. */
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/scsi.h>

int main(int argc, char **argv)
{
         /* This can be run only by root */

         if (argc != 2) {
             fprintf(stderr, "Usage: %s /dev/rmt#\n", argv[0]);
             return 1;
         }

         if (openx(argv[1], O_RDONLY, 0, SC_FORCED_OPEN) < 0) {
             perror(argv[0]);
             return 2;
         }
         return 0;
}

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: comp.unix.aix Frequently Asked Questions (Part 2 of 5)
Previous Document: 1.205: What is tape block size of 0?
Next Document: 1.207: How do I restore specific files from a mksysb tape?

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
bofh@mail.teleweb.pt (Jose Pina Coelho)





Last Update March 27 2014 @ 02:11 PM