This is NeXT-answer-to-tape-drive-problems in view mode; [Up]
Date: Sun 19-Feb-1991 13:14:48 From: weigele@bosun1.informatik.uni-hamburg.de (Martin Weigele) Subject: NeXT answer to tape drive problems (was: Sun tape streamer (was: silly cables) weigele@bosun1.informatik.uni-hamburg.de (Martin Weigele) writes: [About SUN OEM Viper 150 streamer] >The streamer tape is successfully SCSI-recognized during boot, and it is >possible to "mt -f /dev/nrst0 <command>" as well as with /dev/rst0. >This seems to work. However, tar-ing or dd-ing from or to tapes results >in "i/o errors" (I tried with more then one tape). Here's the comment from my dealer who forwarded the information from NeXT: "Hier die Antwort von NeXT: You need to use the MTIOFIXBLK ioctl to set fixed block mode on the device access. Otherwise you should ensure that the transfers are a multiple of 512 bytes, by using the b option to tar. If you do not do this, the access will fail with a SCSI error. This is because the Viper 150 supports only fixed block size accesses. The 2.0 device driver assumes devices can handle variable block sizes. Hence any drive that supports variable size blocks will work automatically with the NeXT at 2.0." >I wonder if there is any "configuration trick". Unfortunately the otherwise >detailed documentation (about ODs and Exabyte drives) does give very >little documentation about /dev/rst0 type streamers. Actually, once you know you need to look up ioctl the extended release documentation has this in the manual pages. Unfortunately, I didn't have the time to try this out yet because I need to borrow the tape drive, but maybe someone else is happy with this info. One solution might be to adapt GNU tar (or maybe this has been done already. We don't have the latest version, probably). Or does anyone know about tape drives which support variable size blocks? Anyone? Martin
Date: Sun 20-Feb-1991 20:25:53 From: jlc2@cbnewse.att.com (john.chmielewski) Subject: NeXT answer to tape drive problems weigele@bosun1.informatik.uni-hamburg.de (Martin Weigele) writes: >[About SUN OEM Viper 150 streamer] >>The streamer tape is successfully SCSI-recognized during boot, and it is >>possible to "mt -f /dev/nrst0 <command>" as well as with /dev/rst0. >>This seems to work. However, tar-ing or dd-ing from or to tapes results >>in "i/o errors" (I tried with more then one tape). > You need to use the MTIOFIXBLK ioctl to set fixed block mode on >the device access. Otherwise you should ensure that the transfers are >a multiple of 512 bytes, by using the b option to tar. If you do not >do this, the access will fail with a SCSI error. This is because the >Viper 150 supports only fixed block size accesses. The 2.0 device >driver assumes devices can handle variable block sizes. Hence any >drive that supports variable size blocks will work automatically with >the NeXT at 2.0." I connected a Wangtec 60 MB tape drive and experienced the same problems. Following the above advice for an alternate to the MTIOFIXBLK ioctl, I tried tar, gnutar, and cpio with no success. I think that when you try to read or write to the tape drive, the SCSI tape driver checks to see if it uses the type of block size the driver is configured for, if not, "i/o errors" is returned. I wrote the following short program to set the SCSI tape driver to a fixed block size of 512 bytes. After running it, I was able to read and write to the drive, using tar, cpio, and cat. I do not know if the driver remembers the configuration between boots, but if it does not, the program could be run from rc.local. I think that mt(1) should be modified to do this, and I also think the SCSI tape driver should be "fixed" to configure itself to the tape drive. ------------------- start of setmtd.c ---------------------- /* * setmtd - set SCSI tape driver to a fixed block size * by John L. Chmielewski * Tue Feb 19, 1991 */ #include <fcntl.h> #include <sys/types.h> #include <nextdev/scsireg.h> #define RSTDEVICE "/dev/rst0" #define BLOCKSIZE 512 main() { int fd, size = BLOCKSIZE; if ((fd = open(RSTDEVICE, O_RDWR)) < 0) { perror(RSTDEVICE); exit(1); } if (ioctl(fd, MTIOCFIXBLK, &size) < 0) { perror("ioctl"); exit(1); } (void) close(fd); return 0; } ------------------- end of setmtd.c ---------------------- -jlc- jlc@alien.att.com
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.