home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / next / hardware / 1583 < prev    next >
Encoding:
Text File  |  1992-09-02  |  8.4 KB  |  203 lines

  1. Newsgroups: comp.sys.next.hardware
  2. Path: sparky!uunet!netnews!capd.jhuapl.edu!waltrip
  3. From: waltrip@capd.jhuapl.edu
  4. Subject: Re: Sun "Archive Python" Tape Drive (long)
  5. Message-ID: <1992Sep2.140310.1@capd.jhuapl.edu>
  6. Lines: 191
  7. Sender: usenet@netnews.jhuapl.edu
  8. Organization: CAPVAX, JHU/APL
  9. References: <1992Sep2.023035.11992@ee.gatech.edu>
  10. Date: Wed, 2 Sep 1992 19:03:10 GMT
  11.  
  12. In article <1992Sep2.023035.11992@ee.gatech.edu>, lockhart@eecom.gatech.edu 
  13. (John B. Lockhart) writes:
  14. > My boss had a few dozen Sun 150 meg tape drives lying about gathering dust,
  15. > so I thought I'd snarf one and use it to backup my 'station with.  Wrong.
  16. > I connected it on it's lonesome (as SCSI id 4) to the NeXT, with a terminator,
  17. > and get I/O errors on all read/writes with gnutar.
  18. > The NeXT recognizes the device by name, /dev/rst0 does cause the drive to
  19. > whirr/rewind the tape on close, mt will write an eof to the tape, and I'm
  20. > sure I've got the blocking factor right (126).  I've also tried it without
  21. > the terminator, and with a different terminator.
  22. > Any ideas on how to get rid o' the I/O errors?
  23.     I've responded to some previous posters by email when this has come up
  24.     before but am posting a response here because I believe that, with
  25.     some judicious editing, the answer--which was previously worked out
  26.     by Dave Johnson--might go into the FAQ.  (In fact, I thought it was
  27.     in there but couldn't find it in my copy--maybe I don't have the
  28.     latest version.)
  29.  
  30.     Here 'tis.
  31. Quote-------------------------------------------------------------------------
  32.  
  33. X-NEWS: capvax comp.sys.next: 39269Path: aplcomm!uunet!gradient!ddj
  34. From: ddj@gradient.gradient.com (david johnson)
  35. Newsgroups: comp.sys.next
  36. Subject: Re: NeXT answer to tape drive problems
  37. Message-ID: <272@gradient.gradient.com>
  38. Date: 26 Feb 91 16:53:59 GMT
  39. References: <1991Feb20.202553.21798@cbnewse.att.com>
  40. Organization: Gradient Technologies Inc., Hudson MA
  41. Lines: 141
  42.  
  43. jlc2@cbnewse.att.com (john.chmielewski) writes:
  44.  
  45. >weigele@bosun1.informatik.uni-hamburg.de (Martin Weigele) writes:
  46. ...
  47. >>    You need to use the MTIOFIXBLK ioctl to set fixed block mode on  
  48. >>the device access. Otherwise you should ensure that the transfers are  
  49. >>a multiple of 512 bytes, by using the b option to tar. If you do not  
  50. >>do this, the access will fail with a SCSI error. This is because the  
  51. >>Viper 150 supports only fixed block size accesses. The 2.0 device  
  52. >>driver assumes devices can handle variable block sizes. Hence any  
  53. >>drive that supports variable size blocks will work automatically with  
  54. >>the NeXT at 2.0."
  55.  
  56. >I connected a Wangtec 60 MB tape drive and experienced the same problems.
  57. >Following the above advice for an alternate to the MTIOFIXBLK ioctl, I
  58. >tried tar, gnutar, and cpio with no success.  I think that when you try
  59. >to read or write to the tape drive, the SCSI tape driver checks to see
  60. >if it uses the type of block size the driver is configured for, if not,
  61. >"i/o errors" is returned.
  62.  
  63. I believe Martin's "Othersize you should ..." was actually meant to be read
  64. "In addition to the ioctl, you must ...."   
  65.  
  66. >I wrote the following short program to set the SCSI tape driver to a fixed
  67. >block size of 512 bytes.  After running it, I was able to read and write to
  68. >the drive, using tar, cpio, and cat.  I do not know if the driver remembers
  69. >the configuration between boots, but if it does not, the program could be
  70. >run from rc.local.  I think that mt(1) should be modified to do this, and
  71. >I also think the SCSI tape driver should be "fixed" to configure itself to
  72. >the tape drive.
  73.  
  74. The provided program also worked for me on an OLD Archive 60MB QIC24 full
  75. height scsi drive, and on a new Mirror Technologies QIC150 external drive
  76. I bought to use at home on both my NeXT and my wife's Mac SE/30.  
  77. ($797+shipping direct from Mirror Technologies,
  78. 800-654-5294/+1 612 633 4450; I talked to Amy).
  79.  
  80. The Mirror drive is based on a Tandberg 3600 transport,
  81. which supports writing in QIC150 format as well as reading QIC24 (60 meg)
  82. tapes written on other systems (I don't recall now but it may also read 
  83. QIC120 mode).  It is in a metal enclosure with two SCSI ports, push-button
  84. scsi selection switch, two convenience outlets, and the power switch on
  85. the back.  The tape is inserted with the tape rollers on the right and
  86. the drive door is closed pushing the tape in the rest of the way.  There
  87. is an LED to indicate tape is loaded and online.
  88.  
  89. Standard DC6150 tapes work as advertised at 150 megabytes, and extended
  90. length tapes (DC6250) are usable for the full 250 megabytes of capacity,
  91. although the MODE_SENSE scsi command does not distinguish between the two
  92. different sized cartridges.  The MODE_SENSE returns a density code of QIC150
  93. for both, and a blocks-in-tape capacity of zero for all tapes I looked at.
  94. (The Archive drive identified a 60 megabyte tape as QIC24 density and 120000
  95. blocks in tape).
  96.  
  97. The tape speed (rated 72 ips) is not quite up to Wangtek or Archive Viper speeds
  98. (rated 90 ips), but I was able to dump my extended distribution of 179900 blocks
  99. in about 36 minutes onto an extended length cartridge, giving roughly 5Mb/min,
  100. not allowing for the overhead of dump scanning the filesystem before
  101. starting to write the tape.  The tape did not stop streaming at all, except
  102. to turn around at the end of each track.
  103.  
  104. I tried to work out the proper density and length parameters to provide to
  105. dump, but ended up approximating them empirically.  As a conservative start,
  106. I would suggest the following options (full dump example):
  107.  
  108. 150 Megabyte tape (DC6150):
  109.     dump 0udsf 40000 620 /dev/rst0 /dev/rsd?a # fake density, real length
  110. or
  111.     dump 0usf 9000 /dev/rst0 /dev/rsd?a      # 1600 density, fake length
  112.  
  113. 250 Megabyte tape (DC6250):
  114.     dump 0udsf 40000 1020 /dev/rst0 /dev/rsd?a # fake density, real length
  115. or
  116.     dump 0usf 15000 /dev/rst0 /dev/rsd?a       # 1600 density, fake length
  117.  
  118. As one experimental data point, using the 1600bpi line immediately above
  119. to write a 150 meg tape as if it were a 250 meg tape terminated with an error
  120. message indicating that it had written 9231 feet of tape (at 1600 bpi 9-track
  121. standard format).  It might be possible to increase the 40000bpi psuedo-
  122. density somewhat, but 45000 was definitely too high and I think 44000 was also.
  123.  
  124. Since I was working with two drives, I made some slight modifications to
  125. setmtd, and now automatically call it from /etc/rc.local as follows
  126. (from memory -- please compare to existing lines in /etc/rc for sanity):
  127.  
  128. (/usr/etc/setmtd /dev/nrst0 && echo " scsi tape 0")        >/dev/console
  129. (/usr/etc/setmtd /dev/nrst1 && echo " scsi tape 1")        >/dev/console
  130.  
  131. ------------------- start of setmtd.c ----------------------
  132. /*
  133.  * setmtd - set SCSI tape driver to a fixed block size
  134.  *    by John L. Chmielewski
  135.  *    Tue Feb 19, 1991
  136.  *
  137.  * Modified to take drive name argument and default to non-rewinding mode:
  138.  *    by David D. Johnson (ddj@gradient.com)
  139.  *    Sun Feb 24, 1991
  140.  */
  141.  
  142. #include <fcntl.h>
  143. #include <sys/types.h>
  144. #include <nextdev/scsireg.h>
  145.  
  146. #define RSTDEVICE    "/dev/nrst0"
  147. #define BLOCKSIZE    512
  148.  
  149. main(argc, argv)
  150.     int argc;
  151.     char *argv[];
  152. {
  153.     int fd, size = BLOCKSIZE;
  154.     char *name = RSTDEVICE;
  155.  
  156.     if (argc > 1)
  157.         name = argv[1];
  158.     if ((fd = open(name, O_RDWR)) < 0)
  159.     {
  160.         perror(name); /* changed according to jlc's
  161.                  post of 26 Feb 91         */
  162.         exit(1);
  163.     }
  164.     if (ioctl(fd, MTIOCFIXBLK, &size) < 0)
  165.     {
  166.         perror("ioctl");
  167.         exit(1);
  168.     }
  169.     (void) close(fd);
  170.     return 0;
  171. }
  172. ------------------- end of setmtd.c ----------------------
  173.  
  174. >                 -jlc-
  175. >        jlc@alien.att.com
  176.  
  177. As a footnote, the MTIOCFIXBLK ioctl controls the format of the
  178. command the st-driver uses to read/write the tape drive.  Since
  179. it does not send any information to the tape drive, it is not
  180. remembered across boots.  The block size of 512 is a requirement
  181. of the formatter of each of the drives I looked at.
  182.  
  183.     -- Dave Johnson
  184.     ddj@gradient.com (via uunet)
  185.  
  186. Unquote----------------------------------------------------------------------
  187.  
  188. I believe I have seen other testimony that this works.  I believe
  189. some other solutions may have been posted.  This, or some other
  190. similar program, may have been posted to the archives.  If it
  191. doesn't work, I'd like to know (don't have my tape drive yet so I
  192. haven't personally checked).
  193.  
  194. _/_/_/_/ _/_/_/_ _/      _/      _/ _/     _/   _/_/_/_/_/ _/_/_/_/ _/ _/_/_/_/
  195. _/  cfwaltrip     _/    _/_/    _/ _/_/    _/       _/     _/    _/ _/ _/    _/
  196. _/       _/_/_/    _/  _/  _/  _/ _/_/_/   _/       _/     _/_/_/_/ _/ _/_/_/_/
  197. _/  Internet: <waltrip@capsrv.jhuapl.edu>  _/       _/     _/  _/   _/ _/
  198. _/_/_/_/ _/          _/      _/ _/      _/ _/_/_/_/ _/     _/    _/ _/ _/
  199.