home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / next / sysadmin / 7093 < prev    next >
Encoding:
Text File  |  1992-12-17  |  1.8 KB  |  59 lines

  1. Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!spool.mu.edu!umn.edu!noc.msc.net!gacvx2.gac.edu!nntp-server!max
  2. Newsgroups: comp.sys.next.sysadmin
  3. Subject: Re: Dump/restore problem with DAT-drive (Major hint!!!)
  4. Message-ID: <MAX.92Dec16104919@Kolmogorov.gac.edu>
  5. From: max@Kolmogorov.gac.edu (Max Hailperin)
  6. Date: 16 Dec 92 10:49:19
  7. Reply-To: Max Hailperin <max@nic.gac.edu>
  8. References: <1992Dec9.101922.618@nexcom.hanse.de> <1gkvvfINN66@menudo.uh.edu><MAX.92Dec16102112@Kolmogorov.gac.edu>
  9. Organization: Gustavus Adolphus College, St. Peter, MN
  10. Nntp-Posting-Host: kolmogorov.gac.edu
  11. In-reply-to: max@Kolmogorov.gac.edu's message of 16 Dec 92 10:21:12Lines: 45
  12. Lines: 45
  13.  
  14. In article <MAX.92Dec16102112@Kolmogorov.gac.edu>
  15. max@Kolmogorov.gac.edu (Max Hailperin) (yes that's me) writes:
  16.  
  17.    [A bunch of stuff about tape read errors that would have been
  18.     correct, except that I'm brain dead and got "allow" and "inhibit"
  19.     backwards.]
  20.  
  21. The correct mode of operation for restoring from a DAT drive is
  22. *inhibit* illegal length, *not* allow.  This is what Sears's
  23. workaround does by using the exabyte device.  The correct solution,
  24. then, is *not* the mtalill program I posted, but rather the converse,
  25. which I naturally call mtinill.  This is what I actually run in my
  26. /etc/rc.local.  Please excuse my earlier error.
  27.  
  28. #include <stdio.h>
  29. #include <sys/ioctl.h>
  30. #include <sys/types.h>
  31. #include <nextdev/scsireg.h>
  32. #include <sys/file.h>
  33.  
  34. main(int argc, char *argv[]){
  35.   int fd;
  36.  
  37.   if(argc != 2){
  38.     fprintf(stderr, "Usage: %s device\n", argv[0]);
  39.     exit(1);
  40.     }
  41.  
  42.   if((fd = open(argv[1], O_RDONLY, 0)) < 0){
  43.     perror(argv[1]);
  44.     exit(1);
  45.   }
  46.  
  47.   if(ioctl(fd, MTIOCINILL, NULL) < 0){
  48.     perror("doing MTIOCINILL ioctl");
  49.     exit(1);
  50.   }
  51.  
  52.   if(close(fd) < 0){
  53.     perror("closing");
  54.     exit(1);
  55.   }
  56.  
  57.   exit(0);
  58. }
  59.