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

  1. Path: sparky!uunet!haven.umd.edu!umd5!umd5.umd.edu!anderson
  2. From: anderson@sapir.cog.jhu.edu (Steve Anderson)
  3. Newsgroups: comp.sys.next.hardware
  4. Subject: Re: Sun "Archive Python" Tape Drive
  5. Message-ID: <ANDERSON.92Sep2074128@sapir.cog.jhu.edu>
  6. Date: 2 Sep 92 11:41:28 GMT
  7. References: <1992Sep2.023035.11992@ee.gatech.edu>
  8. Sender: news@umd5.umd.edu
  9. Organization: Dept. of Cognitive Science, The Johns Hopkins University
  10. Lines: 50
  11. In-reply-to: lockhart@eecom.gatech.edu's message of 2 Sep 92 02:30:35 GMT
  12.  
  13. This has to be the hundredth time this question has been asked. 
  14.  
  15. I think you'll find that the problem is due to the fact that (at least
  16. in 2.x) the SCSI tape driver assumes variable block size, and the
  17. Archive (along with lots of other drives) wants fixed blocks. What you
  18. have to do is reset the driver. Attached is a bit of code posted to
  19. (the ancestor of) this newsgroup last year; compile it, and run it
  20. once to reset the driver. Your Archive drive should then work. You'll
  21. have to rerun it if you reboot; if the Archive (or other fixed
  22. blocksize device) is the only device you use the SCSI tape driver
  23. with, you might want to run it automatically from rc.local at tboot
  24. time.
  25.  
  26. I would have responded by mail, but this question shows up often
  27. enough that I thought someone else out there might also be wondering,
  28. and the code is really pretty short.
  29.  
  30. --Steve Anderson
  31.  
  32. ----------------(included file setmtd.c)--------------------
  33. /*
  34.  * setmd - set SCSI tape driver to a fixed block size
  35.  *       by John L. Chmielewski
  36.  *       Tue Feb 19, 1991
  37.  */
  38.  
  39. #include <fcntl.h>
  40. #include <sys/types.h>
  41. #include <nextdev/scsireg.h>
  42.  
  43. #define RSTDEVICE    "/dev/rst0"
  44. #define BLOCKSIZE    512
  45.  
  46. main()
  47. {
  48.   int fd, size = BLOCKSIZE;
  49.  
  50.   if ((fd = open(RSTDEVICE, O_RDWR)) < 0)
  51.     {
  52.       perror(RSTDEVICE);
  53.       exit(1);
  54.     }
  55.   if (ioctl(fd, MTIOCFIXBLK, &size) < 0)
  56.     {
  57.       perror("ioctl");
  58.       exit(1);
  59.     }
  60.   (void) close(fd);
  61.   return 0;
  62. }
  63.