home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / admin / 4309 < prev    next >
Encoding:
Text File  |  1992-07-24  |  3.0 KB  |  80 lines

  1. Newsgroups: comp.unix.admin
  2. Path: sparky!uunet!decwrl!access.usask.ca!kakwa.ucs.ualberta.ca!news
  3. From: sherwood@fenris.space.ualberta.ca (Sherwood Botsford)
  4. Subject: Re: multiple dumps on EXB-8200 8mm tape
  5. Message-ID: <1992Jul24.181553.10455@kakwa.ucs.ualberta.ca>
  6. Sender: news@kakwa.ucs.ualberta.ca
  7. Nntp-Posting-Host: fenris.space.ualberta.ca
  8. Organization: University Of Alberta, Edmonton Canada
  9. References: <1992Jul23.141833.14606@ferrari.nmc.ed.ray.com>
  10. Distribution: usa
  11. Date: Fri, 24 Jul 1992 18:15:53 GMT
  12. Lines: 66
  13.  
  14. Bill Heiser writes
  15. > The problem I have is that when I write a tapefile to the non-rewinding
  16. > device, and then write another file, when I try to read the files I seem
  17. > to have to skip filemarks sometimes.  For example:  If I write a tape on
  18. > a SunOS 4.1.1_U1 or 4.0.3 system, I have a tape with several tapefiles.
  19. > If I try to read the tape by doing several consecutive 'restore' commands
  20. > on the non-rewinding device, the restores after the first one fail -- unless
  21. > I do a restore, then a "mt -f fsf 1".  So basically I seem to be getting
  22. > extra file marks!
  23.  
  24. This one threw me for a loop initially.
  25. The file mark is not (usually) explicitly written by the program, but is  
  26. written by the computer on closing the file.  It will aslo be done by the tape  
  27. if the previous command was write data, and the the current command is any tape  
  28. movement command.
  29.  
  30. Now, a filemark on either exabyte or DAT drives has a front and back side.   
  31. Front being on the Beginning of Tape side.  
  32.  
  33. Any command that writes to the tape, finishes with a write filemark, and   
  34. leaves the head on the back side of the mark, ready to write the next file.
  35.  
  36. Any command that reads the tape leaves the tape positioned on the BOT side of  
  37. the file mark.
  38.  
  39. mt fsf's and bsf's behave this way too.  A bsf leaves the tape on the front  
  40. edge of the filemakr, and an fsf leaves it on the back.
  41.  
  42. So if you kill an operation, and want to reposition the tape to start it again,  
  43. you must do this:
  44. mt bsf 1
  45. mt fsf 1
  46.  
  47.  
  48. In terms of your problem with the other machine, it may automatically put an  
  49. fsf after a read finishes.  
  50.  
  51. I do modify my scripts behaviour for different machines with an environment  
  52. variable.  Since they are different drivers, I use that.
  53.  
  54. e.g.
  55. #!/usr/local/bin/perl
  56. ..
  57. $TAPE = $ENV{TAPE};
  58. if  ("$TAPE" eq ""); { # No device defined.
  59.   print "TAPE is not defined in your environment.\n";
  60.   &Finish
  61.   }
  62. if  ("$TAPE" eq "/dev/nrxt0"); { &ExabyteSetup; }
  63. if  ("$TAPE" eq "/dev/nrst0"); { &HPDatSetup;}
  64. print "\tUsing tape device $TAPE \n";
  65.  
  66.  
  67. Then in the various setup you can define a command string that is null for the  
  68. machine that doesn't need it, and does an mt fsf 1 for the machine that does  
  69. need it.
  70.  
  71. You could also do this by host name, host type, etc.
  72.  
  73. Hope this helps.
  74.  
  75. ---
  76. => Sherwood Botsford                   sherwood@space.ualberta.ca <= 
  77. => University of Alberta         Lab Manager, Space Physics Group <=         
  78. => tel:403 492-3713                             fax: 403 492-4256 <=         
  79.