No end to problems
I have an ADIC 4mm DAT changer - 12 slot, single HP DDS-I drive. I'm running Linux (RH 7.3) and have installed kernel 2.4.18 w/scsi-changer patch. I can manipulate the robot with the "mover" utility that came with scsi-changer. I can eject, rewind, erase, load, etc. the drive with the Linux mt command. I have even written a file to tape with dd. The first problem was that the built-in SCSI changer scripts/programs that came with Amanda would not work, so I wrote my own script that uses mover and mt to move the arm, load, and unload tapes and return the required return codes and strings to Amanda. So now I can use the following commands with no problems: amtape csd reset amtape csd eject amtape csd slot amlabel does not work. The first problem was (is?) that rewind would ALWAYS fail. I found that the mt eject command will always rewind a tape even if I use the no-rewind device. The ioctl() call within tapeio.c always returns a -1. The second problem is that even though "amlabel csd csd00 slot ", where is a digit, seems to work (no errors are returned), trying to read the label from a tape fails. For example, "amtape csd show" always returns the following: [root@ista root]# amtape csd show amtape: scanning all 12 slots in tape-changer rack: slot 2: reading label: Input/output error slot 3: reading label: Input/output error slot 4: reading label: Input/output error slot 5: reading label: Input/output error slot 6: reading label: Input/output error slot 7: reading label: Input/output error slot 8: reading label: Input/output error slot 9: reading label: Input/output error slot 10: reading label: Input/output error slot 11: reading label: Input/output error slot 0: reading label: Input/output error So, I am at a loss and what I thought should be easy has become a real pain. PGA -- Paul G. Allen Owner, Sr. Engineer, Security Specialist Random Logic/Dream Park www.randomlogic.com
Re: No end to problems
On Sat, 3 Aug 2002, Paul G. Allen wrote: > [root@ista root]# amtape csd show > amtape: scanning all 12 slots in tape-changer rack: > slot 2: reading label: Input/output error > slot 3: reading label: Input/output error > slot 4: reading label: Input/output error > slot 5: reading label: Input/output error > slot 6: reading label: Input/output error > slot 7: reading label: Input/output error > slot 8: reading label: Input/output error > slot 9: reading label: Input/output error > slot 10: reading label: Input/output error > slot 11: reading label: Input/output error > slot 0: reading label: Input/output error One common problem is that some changers will return from a tape load request before the tape is fully loaded and the tape drive is ready to go to work. In these cases it becomes necessary to add some delay time between the tape load command and subsequent tape drive use commands, or else do a sleep/retry/timeout sequence. Here's what worked for me a few years back with a DLT4000 changer: # see if tape drive is ready. if not, sleep a while and check again $remaining = $MAXDELAY; while (!open(TAPE,$TAPE) && $remaining > 0) { $remaining -= sleep 5; } if ($remaining <= 0) { print "$0 drive $TAPE timed out, not responding\n"; exit 2; } I did this just after loading a tape, so any following commands would not have to worry about it. For that changer it took I think close to a minute for the drive to become ready. More recently, with an AIT2 changer I found the open() call here didn't work, so replaced it with a call to mt status and watched the output for "General status bits on". Whatever works. :-) -Mitch
Re: No end to problems
Mitch Collinsworth wrote: > > On Sat, 3 Aug 2002, Paul G. Allen wrote: > > > [root@ista root]# amtape csd show > > amtape: scanning all 12 slots in tape-changer rack: > > slot 2: reading label: Input/output error > > slot 3: reading label: Input/output error > > slot 4: reading label: Input/output error > > slot 5: reading label: Input/output error > > slot 6: reading label: Input/output error > > slot 7: reading label: Input/output error > > slot 8: reading label: Input/output error > > slot 9: reading label: Input/output error > > slot 10: reading label: Input/output error > > slot 11: reading label: Input/output error > > slot 0: reading label: Input/output error > > One common problem is that some changers will return from a tape > load request before the tape is fully loaded and the tape drive is > ready to go to work. In these cases it becomes necessary to add > some delay time between the tape load command and subsequent tape > drive use commands, or else do a sleep/retry/timeout sequence. > > Here's what worked for me a few years back with a DLT4000 changer: > > # see if tape drive is ready. if not, sleep a while and check again > $remaining = $MAXDELAY; > while (!open(TAPE,$TAPE) && $remaining > 0) { > $remaining -= sleep 5; > } > if ($remaining <= 0) { > print "$0 drive $TAPE timed out, not responding\n"; > exit 2; > } > > I did this just after loading a tape, so any following commands would > not have to worry about it. For that changer it took I think close to > a minute for the drive to become ready. > > More recently, with an AIT2 changer I found the open() call here didn't > work, so replaced it with a call to mt status and watched the output for > "General status bits on". > I actually did have to add a delay, but in 2 places. I already had delays in my script of 15 sec. after each load/unload, and a couple seconds after arm movements, but I increased the longer delay to 20 sec. That solved part of the problem, but I was still having issues with rewinds and reads. Adding some debugging printf()'s in tapeio.c, I found that the tapefd_open() function was failing. I added a longer delay in there (changed from 2 to 3 sec.), and now it all seems to be working. I was able to label all 12 tapes and then run "amtape csd show" with success. amcheck -s also works now. Now tomorrow I'll see about performing a test backup (I'm too beat now after working on this all day). PGA -- Paul G. Allen Owner, Sr. Engineer, Security Specialist Random Logic/Dream Park www.randomlogic.com