home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sources / unix / 285 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  46.9 KB

  1. Path: sparky!uunet!haven.umd.edu!decuac!pa.dec.com!vixie
  2. From: thad@btr.com (Thad Floryan)
  3. Newsgroups: comp.sources.unix
  4. Subject: v26i084: tprobe-1.0 - tape saveset analyzer and duplicator, Part01/01
  5. Date: 31 Dec 1992 21:21:01 GMT
  6. Organization: Digital Equipment Corporation Palo Alto, CA
  7. Lines: 1561
  8. Sender: unix-sources-moderator@pa.dec.com
  9. Approved: vixie@pa.dec.com
  10. Message-ID: <1hvo7tINN7h7@usenet.pa.dec.com>
  11. NNTP-Posting-Host: cognition.pa.dec.com
  12. Originator: vixie@cognition.pa.dec.com
  13.  
  14. Submitted-By: thad@btr.com (Thad Floryan)
  15. Posting-Number: Volume 26, Issue 84
  16. Archive-Name: tprobe-1.0/part01
  17.  
  18.                  T P R O B E
  19.  
  20.          Tape Saveset Analyzer and Duplicator
  21.  
  22.      @(#)README V1.0, 12-Feb-1992, Thad Floryan [ thad@btr.com ]
  23.  
  24.  
  25. tprobe is a utility which succeeds duplicating boot/install tapes that are not
  26. easily copied by other means.  One of its features is operation over a pipeline
  27. utilizing multiple tape drives whereever they exist on a network or a system.
  28.  
  29. tprobe can also (indirectly) perform media conversions, though the only
  30. verified conversions have been from QIC-120 and QIC-150 to QIC-24 and vice
  31. versa; there is no inherent limitation, so other conversions are definitely
  32. possible.
  33.  
  34. Another feature is that a tape may be processed without disk space being
  35. usurped for intermediate staging.  Thus, a full 150MB tape can be duplicated
  36. even if one's system has only, say, 20MB free.
  37.  
  38. tprobe's basic operation reveals a tape's existing saveset layout and stored
  39. capacity, and requires only a single tape drive for this analysis.
  40.  
  41. tprobe was intended to be a one-time-only program, but it is useful in its
  42. present incarnation and does solve immediate and present problems.
  43.  
  44. tprobe was conceived when it was realized the SunOS 4.1.1 Sun-3 SUNBIN install
  45. tape was to be the last ever from Sun for that architecture and that a backup
  46. was essential to prevent disaster if the tape should be "bad" when most needed
  47. to boot into a miniroot.
  48.  
  49. Complete nroff-/troff-ready documentation accompanies this distribution.
  50. Additional notes and anecdotes not appropriate for the "man" page follow.
  51.  
  52. tprobe began as a Kwik'N'Dirty program to ascertain the saveset layout of
  53. tapes to discover why "obvious" means of tape duplication were not successful;
  54. varying record sizes were found to be the problem whose solution (for my
  55. purposes) is the present release.
  56.  
  57. An obvious but often neglected fact is that tape drives need to be kept clean.
  58. Many tape subsystem enclosures are poorly-designed, with fans sucking in dust
  59. and atmospheric contaminants over the heads and operating parts.  It's my
  60. opinion that tape drive housings should be constructed with fan(s) blowing
  61. filtered air IN to maintain a positive pressure inside the enclosure as a
  62. barrier to pollution (per the guidelines of clean rooms used in semiconductor
  63. manufacture).  Systems with externally-replaceable filters are the best.
  64.  
  65. For optimum performance and reliability, tapes should also be retensioned
  66. prior to use.  Retensioning (one high speed rewind cycle from end to end)
  67. assures a even tape pack and facilitates accurate tape handling by the tape
  68. drive transport.
  69.  
  70. Always, ALWAYS write-protect a tape after removing it from a drive.  All QIC
  71. and 1/2" cartridges have a tab that can be turned or flipped to a "SAFE"
  72. position; DO IT!  The number of laments posted to Usenet after someone
  73. overwrites a crucial backup is increasing; be SAFE, not SORRY.
  74.  
  75. Remember: the most dangerous command on UNIX, or any system for that matter,
  76. is the RETURN.  Very few commands are retractable.  Be careful!
  77.  
  78. Accompanying this README are extracts from some of my recent Usenet postings
  79. concerning tapes, their formats, their setup and their handling per:
  80.  
  81. README.qic    concerning QIC compatibility
  82. README.2150    concerning Archive 2060S/2150S jumper settings
  83. README.5945    concerning Archive 5945C, SCSI, and Emulex MT02 setup
  84. README.exb    concerning Exabyte EXB-8200 capacities and setup
  85. README.tzk10    concerning DEC's TZK10 and Archive's ST525 drives
  86.  
  87. Thad Floryan [ thad@btr.com (OR) {decwrl, mips, fernwood}!btr!thad ]
  88.  
  89. #! /bin/sh
  90. # This is a shell archive.  Remove anything before this line, then unpack
  91. # it by saving it into a file and typing "sh file".  To overwrite existing
  92. # files, type "sh file -c".  You can also feed this as standard input via
  93. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  94. # will see the following message at the end:
  95. #        "End of archive 1 (of 1)."
  96. # Contents:  MANIFEST Makefile Makefile.3b1 README README.2150
  97. #   README.5945 README.exb README.qic README.tzk10 tprobe.c tprobe.man
  98. # Wrapped by vixie@cognition.pa.dec.com on Wed Dec 30 11:36:20 1992
  99. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  100. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  101.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  102. else
  103. echo shar: Extracting \"'MANIFEST'\" \(437 characters\)
  104. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  105. X   File Name        Archive #    Description
  106. X-----------------------------------------------------------
  107. X MANIFEST                   1    
  108. X Makefile                   1    
  109. X Makefile.3b1               1    
  110. X README                     1    
  111. X README.2150                1    
  112. X README.5945                1    
  113. X README.exb                 1    
  114. X README.qic                 1    
  115. X README.tzk10               1    
  116. X tprobe.c                   1    
  117. X tprobe.man                 1    
  118. END_OF_FILE
  119. if test 437 -ne `wc -c <'MANIFEST'`; then
  120.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  121. fi
  122. # end of 'MANIFEST'
  123. fi
  124. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  125.   echo shar: Will not clobber existing file \"'Makefile'\"
  126. else
  127. echo shar: Extracting \"'Makefile'\" \(1211 characters\)
  128. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  129. X# Generic Makefile for tprobe
  130. X#
  131. X# make        will create the tprobe executable in the current directory
  132. X# make catman    will create catman-style documentation in the current directory
  133. X# make install    will mv(1) the executable to the specified $(DEST) directory
  134. X# make clean    will tidy-up the current directory after a link or install
  135. X# make lint    will check the source for programming irregularities
  136. X# make lintp    will check the source for portability considerations
  137. X#
  138. X# Several options can be uncommented for configuration on your system.
  139. X
  140. CC    =    cc
  141. X
  142. X# Uncomment or change as appropriate for your system:
  143. X#
  144. COPT    =    -O
  145. X#CDBG    =    -g
  146. X#CPROF    =    -p -g
  147. X#
  148. CFLAGS    =    $(COPT) $(CDBG) $(CPROF)
  149. X
  150. LDFLAGS =    -s
  151. X
  152. X# Uncomment or change as appropriate for your system:
  153. X#
  154. X#LSVR3    =    -lc_s
  155. X#
  156. LIBS    =    $(LSVR3)
  157. X
  158. NAME    =    tprobe
  159. OBJS    =    tprobe.o
  160. SRCS    =    tprobe.c
  161. MANF    =    tprobe.man
  162. MANEXT    =    1
  163. X
  164. DEST    =    /usr/local/bin
  165. XFMODE    =    555
  166. X
  167. X$(NAME)    :    $(OBJS)
  168. X        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  169. X
  170. install :    $(NAME)
  171. X        mv    $(NAME)  $(DEST)/
  172. X        chmod $(FMODE) $(DEST)/$(NAME)
  173. X
  174. catman    :    $(NAME).$(MANEXT)
  175. X
  176. X$(NAME).$(MANEXT) : $(MANF)
  177. X        nroff -man $(MANF) > $(NAME).$(MANEXT)
  178. X
  179. clean    :
  180. X        rm -f core *~ $(OBJS)
  181. X
  182. lint    :
  183. X        lint $(SRCS)
  184. X
  185. lintp    :
  186. X        lint -p $(SRCS)
  187. END_OF_FILE
  188. if test 1211 -ne `wc -c <'Makefile'`; then
  189.     echo shar: \"'Makefile'\" unpacked with wrong size!
  190. fi
  191. # end of 'Makefile'
  192. fi
  193. if test -f 'Makefile.3b1' -a "${1}" != "-c" ; then 
  194.   echo shar: Will not clobber existing file \"'Makefile.3b1'\"
  195. else
  196. echo shar: Extracting \"'Makefile.3b1'\" \(1140 characters\)
  197. sed "s/^X//" >'Makefile.3b1' <<'END_OF_FILE'
  198. X# 3B1 Makefile for tprobe
  199. X#
  200. X# make        will create the tprobe executable in the current directory
  201. X# make cat    will create catman-style documentation in the current directory
  202. X# make install    will mv(1) the executable to the specified $(DEST) directory
  203. X# make clean    will tidy-up the current directory after a link or install
  204. X# make lint    will check the source for programming irregularities
  205. X# make lintp    will check the source for portability considerations
  206. X#
  207. X# Several options can be uncommented for configuration on your system.
  208. X
  209. CC    =    gcc
  210. X
  211. X# Uncomment or change as appropriate for your system:
  212. X#
  213. COPT    =    -O
  214. X#CDBG    =    -g
  215. X#CPROF    =    -p -g
  216. X#
  217. CFLAGS    =    $(COPT) $(CDBG) $(CPROF)
  218. X
  219. LDFLAGS =    -s
  220. X
  221. LIBS    =    /lib/crt0s.o /lib/shlib.ifile
  222. X
  223. NAME    =    tprobe
  224. OBJS    =    tprobe.o
  225. SRCS    =    tprobe.c
  226. MANF    =    tprobe.man
  227. MANEXT    =    1
  228. X
  229. DEST    =    /usr/local/bin
  230. XFMODE    =    555
  231. X
  232. X$(NAME)    :    $(OBJS)
  233. X        $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  234. X
  235. install :    $(NAME)
  236. X        mv    $(NAME)  $(DEST)/
  237. X        chmod $(FMODE) $(DEST)/$(NAME)
  238. X
  239. cat    :    $(NAME).$(MANEXT)
  240. X
  241. X$(NAME).$(MANEXT) : $(MANF)
  242. X        nroff -man $(MANF) > $(NAME).$(MANEXT)
  243. X
  244. clean    :
  245. X        rm -f core *~ $(OBJS)
  246. X
  247. lint    :
  248. X        lint $(SRCS)
  249. X
  250. lintp    :
  251. X        lint -p $(SRCS)
  252. END_OF_FILE
  253. if test 1140 -ne `wc -c <'Makefile.3b1'`; then
  254.     echo shar: \"'Makefile.3b1'\" unpacked with wrong size!
  255. fi
  256. # end of 'Makefile.3b1'
  257. fi
  258. if test -f 'README' -a "${1}" != "-c" ; then 
  259.   echo shar: Will not clobber existing file \"'README'\"
  260. else
  261. echo shar: Extracting \"'README'\" \(3465 characters\)
  262. sed "s/^X//" >'README' <<'END_OF_FILE'
  263. X                 T P R O B E
  264. X
  265. X         Tape Saveset Analyzer and Duplicator
  266. X
  267. X     @(#)README V1.0, 12-Feb-1992, Thad Floryan [ thad@btr.com ]
  268. X
  269. X
  270. tprobe is a utility which succeeds duplicating boot/install tapes that are not
  271. easily copied by other means.  One of its features is operation over a pipeline
  272. utilizing multiple tape drives whereever they exist on a network or a system.
  273. X
  274. tprobe can also (indirectly) perform media conversions, though the only
  275. verified conversions have been from QIC-120 and QIC-150 to QIC-24 and vice
  276. versa; there is no inherent limitation, so other conversions are definitely
  277. possible.
  278. X
  279. Another feature is that a tape may be processed without disk space being
  280. usurped for intermediate staging.  Thus, a full 150MB tape can be duplicated
  281. even if one's system has only, say, 20MB free.
  282. X
  283. tprobe's basic operation reveals a tape's existing saveset layout and stored
  284. capacity, and requires only a single tape drive for this analysis.
  285. X
  286. tprobe was intended to be a one-time-only program, but it is useful in its
  287. present incarnation and does solve immediate and present problems.
  288. X
  289. tprobe was conceived when it was realized the SunOS 4.1.1 Sun-3 SUNBIN install
  290. tape was to be the last ever from Sun for that architecture and that a backup
  291. was essential to prevent disaster if the tape should be "bad" when most needed
  292. to boot into a miniroot.
  293. X
  294. Complete nroff-/troff-ready documentation accompanies this distribution.
  295. Additional notes and anecdotes not appropriate for the "man" page follow.
  296. X
  297. tprobe began as a Kwik'N'Dirty program to ascertain the saveset layout of
  298. tapes to discover why "obvious" means of tape duplication were not successful;
  299. varying record sizes were found to be the problem whose solution (for my
  300. purposes) is the present release.
  301. X
  302. An obvious but often neglected fact is that tape drives need to be kept clean.
  303. Many tape subsystem enclosures are poorly-designed, with fans sucking in dust
  304. and atmospheric contaminants over the heads and operating parts.  It's my
  305. opinion that tape drive housings should be constructed with fan(s) blowing
  306. filtered air IN to maintain a positive pressure inside the enclosure as a
  307. barrier to pollution (per the guidelines of clean rooms used in semiconductor
  308. manufacture).  Systems with externally-replaceable filters are the best.
  309. X
  310. XFor optimum performance and reliability, tapes should also be retensioned
  311. prior to use.  Retensioning (one high speed rewind cycle from end to end)
  312. assures a even tape pack and facilitates accurate tape handling by the tape
  313. drive transport.
  314. X
  315. Always, ALWAYS write-protect a tape after removing it from a drive.  All QIC
  316. and 1/2" cartridges have a tab that can be turned or flipped to a "SAFE"
  317. position; DO IT!  The number of laments posted to Usenet after someone
  318. overwrites a crucial backup is increasing; be SAFE, not SORRY.
  319. X
  320. Remember: the most dangerous command on UNIX, or any system for that matter,
  321. is the RETURN.  Very few commands are retractable.  Be careful!
  322. X
  323. Accompanying this README are extracts from some of my recent Usenet postings
  324. concerning tapes, their formats, their setup and their handling per:
  325. X
  326. README.qic    concerning QIC compatibility
  327. README.2150    concerning Archive 2060S/2150S jumper settings
  328. README.5945    concerning Archive 5945C, SCSI, and Emulex MT02 setup
  329. README.exb    concerning Exabyte EXB-8200 capacities and setup
  330. README.tzk10    concerning DEC's TZK10 and Archive's ST525 drives
  331. X
  332. X
  333. Thad Floryan [ thad@btr.com (OR) {decwrl, mips, fernwood}!btr!thad ]
  334. END_OF_FILE
  335. if test 3465 -ne `wc -c <'README'`; then
  336.     echo shar: \"'README'\" unpacked with wrong size!
  337. fi
  338. # end of 'README'
  339. fi
  340. if test -f 'README.2150' -a "${1}" != "-c" ; then 
  341.   echo shar: Will not clobber existing file \"'README.2150'\"
  342. else
  343. echo shar: Extracting \"'README.2150'\" \(1675 characters\)
  344. sed "s/^X//" >'README.2150' <<'END_OF_FILE'
  345. X         Viper 2060S and 2150S hardware setup
  346. X
  347. X
  348. Hardware setup amongst the 9 sets of jumpers includes:
  349. X
  350. X    SCSI ID:    3 sets of jumpers
  351. X    Serial:        this should NOT be set
  352. X    Diagnostic:    this should NOT be set
  353. X    Parity Enable:    setting depends on your interface; either EVERYTHING
  354. X            or NOTHING on the bus should be checking parity.
  355. X    Buffer Disc:    3 sets of jumpers select 2, 4, 6, 8, 12, 16, 24 and
  356. X            32K buffer sizes.  Factory default is 16K.  This is
  357. X            the number of bytes transferred over the bus in a
  358. X            single operation.  A mininum of 16K is required for
  359. X            the SCSI "COPY" command.
  360. X
  361. X
  362. Where to find all this at the back of the drive:
  363. X
  364. X    [OOOO]    TTTTTTTT TTTTTTTT TTTTTTTT
  365. X     [JJ]    SSSSSSSSSSSSSSSSSSSSSSSSSS
  366. X
  367. X    Where:    [OOOO]    is the power connector
  368. X         [JJ]    is the jumper block
  369. X        TTTTTT    are the three 8-pin terminators
  370. X        SSSSSS    is the 25x2 SCSI connector
  371. X
  372. X    The jumper block looks like this (in the orientation as above):
  373. X
  374. X    [ SERIAL ]    [  CF2    ]    [  ID2    ]
  375. X    [  DIAG. ]    [  CF1    ]    [  ID1    ]
  376. X    [ PARITY ]    [  CF0    ]    [  ID0    ]
  377. X
  378. X    SERIAL: no jumper
  379. X    DIAG:    no jumper
  380. X    PARITY: jumper to enable
  381. X
  382. X    ============================= BUFFER ==============================
  383. X
  384. X    SIZE:    2K    4K    6K    8K    12K    16K    24K    32K
  385. X
  386. X    CF2:    o o    o o    o o    o o    [o=o]   [o=o]   [o=o]   [o=o]
  387. X    CF1:    o o    o o    [o=o]   [o=o]    o o    o o    [o=o]   [o=o]
  388. X    CF0:    o o    [o=o]    o o    [o=o]    o o    [o=o]    o o    [o=o]
  389. X
  390. X
  391. X    ============================= SCSI ID =============================
  392. X
  393. X    ID:     0     1     2     3     4     5     6     7
  394. X
  395. X    ID2:    o o    o o    o o    o o    [o=o]   [o=o]   [o=o]   [o=o]
  396. X    ID1:    o o    o o    [o=o]   [o=o]    o o    o o    [o=o]   [o=o]
  397. X    ID0:    o o    [o=o]    o o    [o=o]    o o    [o=o]    o o    [o=o]
  398. X
  399. X    ===================================================================
  400. END_OF_FILE
  401. if test 1675 -ne `wc -c <'README.2150'`; then
  402.     echo shar: \"'README.2150'\" unpacked with wrong size!
  403. fi
  404. # end of 'README.2150'
  405. fi
  406. if test -f 'README.5945' -a "${1}" != "-c" ; then 
  407.   echo shar: Will not clobber existing file \"'README.5945'\"
  408. else
  409. echo shar: Extracting \"'README.5945'\" \(2440 characters\)
  410. sed "s/^X//" >'README.5945' <<'END_OF_FILE'
  411. X>I have a surplus Archive 5945C QIC tape drive intended for an
  412. X>NCR Tower computer.  The drive assembly includes an interface
  413. X>board of some kind.  The adapter board, which is separate from
  414. X>the tape drive, has a 50 pin edge connector.
  415. X>
  416. X>Is this a SCSI assembly?
  417. X
  418. No, it is not a SCSI assembly.
  419. X
  420. I have identical drives/cards on my Britton-Lee/ShareBase boxes, and on
  421. X3B1, CT MiniFrame, and CT MightyFrame systems.
  422. X
  423. The drive is QIC-02; the interface card accompanying it (assuming it's
  424. mfd by Archive) is most likely a QIC-36 to QIC-02 adapter/translator.
  425. X
  426. On the 50-wire edge connector, not many of the "pins" are used.  In fact,
  427. when used in external tape-drive-only shoeboxes, Archive has two interface
  428. cards which adapt an external connector to the 50-wire edge connector per:
  429. X
  430. X    D-37 connector to 50-wire edge: 80332-001
  431. X    DB25 connector to 50-wire edge: 80221-001
  432. X
  433. These connector-adapter cards are about 1" x 3", and are intended to be
  434. mounted on the "wall" of an enclosure case.
  435. X
  436. When that tape-drive/card is (typically) mounted inside a computer, a 50-wire
  437. ribbon connector is usually used to connect the drive to either a motherboard
  438. or an internal expansion card.  This is why "pulls" (a surplussed drive from
  439. an old computer) are often mistaken for being a SCSI drive.
  440. X
  441. If the accompanying card is an Emulex MT02 (as used on Sun3 systems, for
  442. example), then you could use that drive on a SCSI bus.  The 25x2 SCSI connector
  443. and the two 14-PIN 220/330 Ohm terminator sockets would be obvious; the ID
  444. selection is not obvious (due to use of an unlabelled 8-pos'n DIP switch):
  445. X
  446. X    SW-1 thru SW-3 select SCSI ID per:
  447. X        SW-3 is bit "2", SW-2 is bit "1", SW-1 is bit "0"
  448. X
  449. X    SW-4 is not used.
  450. X
  451. X    SW-5 must be ON ("tach" rate), SW-6 and SW-7 must be OFF
  452. X
  453. X    SW-8 enables parity checking
  454. X
  455. SUMMARY: if the card accompanying the drive is mfd by Archive, it's NOT SCSI,
  456. and you risk damage attempting to adapt a cable to plug it into a SCSI-based
  457. system.
  458. X
  459. WITHOUT EXCEPTION, of the 100's of HDs, tape drives, and other peripherals
  460. I've seen, SCSI ones will have a 25x2 dual-row pin connector whose pins are
  461. on 0.100" centers, and they'll also have an "obvious" location for SCSI
  462. terminators (either 14-/16-pin DIP sockets, several SIP sockets, or one
  463. large 24-DIP socket), and either a DIP switch or jumpers for selecting other
  464. SCSI and mfr-specific parameters (such as parity, buffer sizes, delayed power-
  465. on, "PIN 26" TERMPWR selections, etc.).
  466. END_OF_FILE
  467. if test 2440 -ne `wc -c <'README.5945'`; then
  468.     echo shar: \"'README.5945'\" unpacked with wrong size!
  469. fi
  470. # end of 'README.5945'
  471. fi
  472. if test -f 'README.exb' -a "${1}" != "-c" ; then 
  473.   echo shar: Will not clobber existing file \"'README.exb'\"
  474. else
  475. echo shar: Extracting \"'README.exb'\" \(1931 characters\)
  476. sed "s/^X//" >'README.exb' <<'END_OF_FILE'
  477. X>Could someone tell me if an Exabyte 8200 puts 2.3GB on
  478. X>a 90 or 120 minute tape?
  479. X
  480. Depends what cartridge TYPE you're using, and whether you're operating the
  481. drive in "international mode" or not.
  482. X
  483. XFrom Exabyte's "Product Specification" manual, they identify the P5 and P6
  484. cartridges, and they list the track and total block capacities from which
  485. the following table is an extract.  The block count represents the number
  486. of 1024-byte blocks.  Their table is in hex, but I just happen to have my
  487. Casio fx-451 calculator handy for conversions to decimal!
  488. X
  489. Cartridge    Blocks (LBOT to LEOT)
  490. X
  491. P5-15         5C100H =   377,088    * 1024 =   386,138,112 bytes
  492. P5-30         BC2B8H =   770,744    * 1024 =   789,241,856 bytes
  493. P5-60        172FF8H = 1,519,608    * 1024 = 1,556,078,592 bytes
  494. P5-90        22C668H = 2,279,016    * 1024 = 2,333,712,384 bytes
  495. X
  496. P6-15         407E0H =   264,160    * 1024 =   270,499,840 bytes
  497. P6-30         80FC0H =   528,320    * 1024 =   540,999,680 bytes
  498. P6-60        102020H = 1,056,800    * 1024 = 1,082,163,200 bytes
  499. P6-90        182EA0H = 1,584,800    * 1024 = 1,622,835,200 bytes
  500. P6-120        1FF0E0H = 2,093,280    * 1024 = 2,143,518,720 bytes
  501. X
  502. X--------------------
  503. X
  504. So far I've seen two styles of EXB-8200 drives whose external option jumperings
  505. do NOT resemble those depicted in the Exabyte manuals (various forms of the
  506. XEXABYTE CORP EXB-8200 8MM Cartridge Tape Subsystem Product Specification,
  507. part number MKT-015-03).
  508. X
  509. Another Exabyte manual is their "Interface User's Manual", MKT-016-04, which
  510. on pages 115-117 show how to set (or check) parity, even/odd byte disconnect,
  511. domestic/international cartridges, fixed/variable block modes, etc.) on an
  512. INTERNAL (to the drive) PC card [ and it's a bear to open the drive's card
  513. cage due to cheap tin (putty? :-) screws whose heads disintegrate even with a
  514. proper ISO metric screwdriver (same problem with Japanese audio gear;
  515. difficult to believe that with the world's most modern steel mills, their
  516. steel is the worse (too soft)) ]
  517. END_OF_FILE
  518. if test 1931 -ne `wc -c <'README.exb'`; then
  519.     echo shar: \"'README.exb'\" unpacked with wrong size!
  520. fi
  521. # end of 'README.exb'
  522. fi
  523. if test -f 'README.qic' -a "${1}" != "-c" ; then 
  524.   echo shar: Will not clobber existing file \"'README.qic'\"
  525. else
  526. echo shar: Extracting \"'README.qic'\" \(2742 characters\)
  527. sed "s/^X//" >'README.qic' <<'END_OF_FILE'
  528. X[concerning QIC compatibility]
  529. X
  530. Seems some clarification is required here.  Irrespective of the drive's
  531. interface (QIC-02, SCSI, etc.) there are several TRACK formats common to all
  532. QIC (Quarter Inch Cartridge) tapes with several levels of upward-compatible
  533. READ conformance.
  534. X
  535. All the QIC drives perform "serpentine" (hence Archive's Viper, Cobra, etc.)
  536. recording meaning one track at a time is recorded in one direction, then the
  537. heads move and subsequent recording occurs in the opposite direction, etc.
  538. X
  539. Much like the compatibility between {mono, stereo, quad} Philips "Compact
  540. Cassettes" (tm) for audio, the QIC manufacturers have agreed upon:
  541. X
  542. QIC-11    4 tracks
  543. X
  544. QIC-24    9 tracks. 60MB with DC600A tape.
  545. X    Tracks 0-3  are READ-compatible with the 4 tracks of QIC-11
  546. X
  547. QIC-120    15 (??) tracks [see below] 120MB with DC6150 tape.
  548. X    Tracks 0-3  are READ-compatible with the 4 tracks of QIC-11
  549. X    Tracks 0-8  are READ-compatible with the 9 tracks of QIC-24
  550. X
  551. HP    16 tracks.  Pre-formatted from H-P and incompatible with everything.
  552. X
  553. QIC-150    18 tracks. 150MB with DC6150 tape; 250MB with DC6250 tape.
  554. X    Tracks 0-3  are READ-compatible with the  4 tracks of QIC-11
  555. X    Tracks 0-8  are READ-compatible with the  9 tracks of QIC-24
  556. X    Tracks 0-14 are READ-compatible with the 15 tracks of QIC-120
  557. X
  558. QIC-525    ?? tracks. 525MB with DC6525 tape.
  559. X    Tracks 0-8  are READ-compatible with the  9 tracks of QIC-24
  560. X    Tracks 0-14 are READ-compatible with the 15 tracks of QIC-120
  561. X    Tracks 0-17 are READ-compatible with the 18 tracks of QIC-150
  562. X
  563. NOTE that Sun publishes "A Tutorial on 1/4 Inch Tape Drives", Part Number
  564. X800-1315-02, which describes all the operational characteristics of such
  565. drives and graphically depicts the track layouts illustrating the WHY and
  566. HOW of the read compatibilities.
  567. X
  568. NOTE the QIC-150 drive can write 250MB using a longer tape (DC6250) analogous
  569. to the difference between C-90 and C-120 audio cassettes.
  570. X
  571. NOTE the QIC-525 drive is NOT read-compatible with QIC-11.
  572. X
  573. NOTE it wasn't made clear to me by Maynard (Archive's end-user and support
  574. organization) the "true" differences between QIC-120 and QIC-150 drives; it's
  575. either or both the number of tracks and/or the recording density, so take the
  576. X"15-tracks of QIC-120" with a grain of salt until someone else posts the
  577. definitive answer.
  578. X
  579. The newer drives are able to automatically sense the recording density and
  580. make internal adjustments for read-compatibility.
  581. X
  582. But, whew, the extra calendaring of the tape's surface and the exotic coating
  583. for the DC6525 media have pushed its list price (from Archive) up to $79 (this
  584. from a price list at UniForum in January 1992) per cartridge.
  585. X
  586. If you want the info direct from THE manufacturer:
  587. X
  588. X    uunet!maynhbd!info (OR) info@maynhbd.UUCP
  589. X    1-800-821-8782
  590. END_OF_FILE
  591. if test 2742 -ne `wc -c <'README.qic'`; then
  592.     echo shar: \"'README.qic'\" unpacked with wrong size!
  593. fi
  594. # end of 'README.qic'
  595. fi
  596. if test -f 'README.tzk10' -a "${1}" != "-c" ; then 
  597.   echo shar: Will not clobber existing file \"'README.tzk10'\"
  598. else
  599. echo shar: Extracting \"'README.tzk10'\" \(1657 characters\)
  600. sed "s/^X//" >'README.tzk10' <<'END_OF_FILE'
  601. X>[...]
  602. X>DEC now offers a 1/4" tape drive - TZK10, which can be used
  603. X>for backup, etc.  The tapes can hold up to 525Mb.  This is
  604. X>significantly more than SUN tape drives, but I heard that the
  605. X>drives are compatible, i.e. you can read SUN tapes on the TZK10 (tar).
  606. X>Is this true?  Also, does anyone know the type of tapes that hold
  607. X>up to 525Mb and their ballpark price.  I currently have a TK50 and
  608. X>would like to move to something with more capacity and not too much $$.
  609. X>[...]
  610. X
  611. What you're describing sounds much like Archive's new ST525 series which
  612. use the QIC-525 "format" for 525MB.
  613. X
  614. If this IS, in fact, the situation, then the drive would be READ compatible
  615. with QIC-24 (60MB with DC600A tape, 9 tracks), QIC-120, and QIC-150(150MB with
  616. DC6150 tapes or 250MB with DC6250 tapes, 18 tracks) as used on Sun (and other)
  617. systems.
  618. X
  619. XFrom Archive's latest pricing sheet (just received last week from Maynard,
  620. Archive's end-user and support subsidiary):
  621. X
  622. X    90507    DC6250 media        $69.00
  623. X    90509    DC6525 media        $79.00
  624. X
  625. Those prices are their "US Retail."  Given that 3M DC6250 tapes are < $29
  626. locally (Silicon Valley: Fry's Electronics, a "consumer"-type store), you
  627. should be able to adjust the (expected) price for 3M DC6525 accordingly.
  628. X
  629. Archive's/Maynard's "US Retail" pricing for a "raw" ST525 drive is $1,528
  630. for their "ST525i internal 525MB SCSI drive kit" and $1,880 for their
  631. X"ST525e external 525MB SCSI drive kit."
  632. X
  633. I dunno; as much as I like Archive drives (over 20 of them here), that
  634. X"list" pricing is comparable to Exabyte EXB-8200 drives which can store
  635. X4x more data (2.3GB on P5-90 cartridges).
  636. X
  637. X
  638. X[ NOTE: prices quoted above are circa January 1992 ]
  639. END_OF_FILE
  640. if test 1657 -ne `wc -c <'README.tzk10'`; then
  641.     echo shar: \"'README.tzk10'\" unpacked with wrong size!
  642. fi
  643. # end of 'README.tzk10'
  644. fi
  645. if test -f 'tprobe.c' -a "${1}" != "-c" ; then 
  646.   echo shar: Will not clobber existing file \"'tprobe.c'\"
  647. else
  648. echo shar: Extracting \"'tprobe.c'\" \(11058 characters\)
  649. sed "s/^X//" >'tprobe.c' <<'END_OF_FILE'
  650. X/*
  651. X *    tprobe    - tape analyzer and duplicator
  652. X *
  653. X *    usage: tprobe  [ -b N ] [ -r | -w ]  /dev/tapedevice
  654. X *
  655. X *    "-b N" specifies a buffersize N other than the default 65536 bytes.
  656. X *
  657. X *    "-r" reads tapedevice and writes to stdout in a special form designed
  658. X *    to be piped to another tprobe process (even across a net) for writing
  659. X *    (i.e. duplicating) a tape onto a second tape drive.
  660. X *
  661. X *    "-w" reads stdin specially formatted by another tprobe process and
  662. X *    writes (i.e. duplicates) to tapedevice.
  663. X *
  664. X *    with no options (other than -b), tprobe reads tapedevice and writes
  665. X *    a brief analysis its findings to stdout.
  666. X *
  667. X *    Adding switch "-d" for the read-side permits a file (instead of a tape)
  668. X *    to be used for testing purposes; only works if compiled with -DDEBUG.
  669. X *
  670. X *    In general, the tape should be rewound before the first use of tprobe.
  671. X *    And the tapedevice "should" be the no-rewind on close device; for
  672. X *    example:
  673. X *
  674. X *        3B1:        /dev/rmt4
  675. X *        CTIX:        /dev/rmt4
  676. X *        SunOS 4.1.1:    /dev/nrst8
  677. X *
  678. X *    To rewind the tape (before and) after using tprobe:
  679. X *
  680. X *        3B1:        qrewind            (Thad's QIC-02 program)
  681. X *        CTIX:        tsioctl -c rewind /dev/rmt0
  682. X *        SunOS 4.1.1:    mt -f /dev/rst8 rewind
  683. X *
  684. X * REVISION HISTORY:
  685. X *
  686. X * 1991        ----    T.Floryan, original Kwik'N'Dirty program for own use
  687. X * 12-Feb-1992    V1.0    T.Floryan, release to Usenet after lint-fixing, etc.
  688. X *            Comments, suggestions, complaints to thad@btr.com
  689. X *
  690. X */
  691. X
  692. X#include <stdio.h>
  693. X#include <fcntl.h>
  694. X#include <errno.h>
  695. X#include <malloc.h>        /* added to suppress some of lint's whining */
  696. X
  697. extern    void    exit();
  698. extern    char    *strncpy();
  699. extern    int    open();
  700. extern    int    read();
  701. extern    int    write();
  702. extern    int    atoi();
  703. X
  704. void    probe_tape();
  705. void    read_tape();
  706. void    write_tape();
  707. void    usage();
  708. X
  709. typedef int        MWORD;
  710. typedef int        LWORD;    /* sizeof(int) must be sizeof(long) */
  711. typedef unsigned int    UWORD;
  712. X
  713. X#define STDIN    0        /* for read() device        */
  714. X#define STDOUT    1        /* for write() device        */
  715. X#define BLKSIZE    512        /* QIC tape physical blocking    */
  716. X#define TBUFSIZ    65536        /* default R/W buffer size    */
  717. X#define MINBUF    512        /* minimum R/W buffer size: 2^9    */
  718. X#define MAXBUF    1048576        /* maximum R/W buffer size: 2^20*/
  719. X#define UMASK    0666        /* needed for creat(2) usage    */
  720. X#define VERSKIP    4        /* skip displacement in version string */
  721. X
  722. X
  723. X/*    The following headers represent the control information passed
  724. X *    by a tape reader process to a tape writer process
  725. X */
  726. X#define HDRSIZE    10        /* size of a control header    */
  727. X
  728. X#define SCANSTR    "%8ld"
  729. X#define BUFHDR    "B%08ld\n"
  730. X#define DATHDR    "D%08ld\n"
  731. X#define SIZHDR    "S%08ld\n"
  732. X#define CLSHDR    "C00000000\n"
  733. X#define ERRHDR    "E00000000\n"
  734. X#define EOTHDR    "T00000000\n"
  735. X
  736. X
  737. X#define STATSTR    "SS%4d: %7ld blocks, %10ld bytes\n"
  738. X#define GTTLSTR    "GTotal: %7ld blocks, %10ld bytes\n"
  739. X
  740. X#ifdef DEBUG
  741. int debug = 0;
  742. char *cmd_options = "b:rwd?hH";
  743. X#else
  744. char *cmd_options = "b:rw?hH";
  745. X#endif
  746. X
  747. LWORD    tbufsize = TBUFSIZ;
  748. X
  749. char *version =
  750. X    "@(#)tprobe V1.0, 12-Feb-1992, Thad Floryan [ thad@btr.com ]";
  751. X
  752. char *usage_text[] = {
  753. X    "usage:    tprobe [-b N] [-r] tapedev [ | tprobe [-b N] -w tapedev ]",
  754. X    "where:    -b  sets buffer size to N (overriding the default 65536)",
  755. X    "    -r  specifies \"this\" process to be the tape reader",
  756. X    "    -w  designates \"this\" process to be a tape writer",
  757. X    0
  758. X};
  759. X
  760. X
  761. main(argc, argv)
  762. X    int    argc;
  763. X    char    *argv[];
  764. X{
  765. X    extern int     getopt();
  766. X    extern int     optind;
  767. X    extern char    *optarg;
  768. X
  769. X    MWORD    mode = 0;    /* 0=analysis, 1=read, 2=write    */
  770. X    MWORD    bufset = 0;    /* non-zero if "-b" specified */
  771. X    MWORD    optchr;
  772. X
  773. X
  774. X/*
  775. X *    Quick check to see if the program CAN run on this system due
  776. X *    to various assumptions.
  777. X */
  778. X    if (sizeof(int) != sizeof(long)) {
  779. X        (void) fprintf(stderr, "Program won't run on this system\n");
  780. X        exit(1);
  781. X    }
  782. X/*
  783. X *    Process options
  784. X */
  785. X
  786. X    while ( ( optchr = getopt( argc, argv, cmd_options ) ) != EOF ) {
  787. X
  788. X        switch (optchr) {
  789. X
  790. X        case 'b':    if (bufset != 0) {
  791. X                (void) fprintf(stderr,
  792. X                "%s: buffer size already set\n", argv[0]);
  793. X                usage();
  794. X            }
  795. X            ++bufset;
  796. X            tbufsize = atoi(optarg);
  797. X            if ((tbufsize < MINBUF) || (tbufsize > MAXBUF)) {
  798. X                (void) fprintf(stderr,
  799. X                "%s: unreasonable buffer size (%ld)\n",
  800. X                argv[0], tbufsize);
  801. X                usage();
  802. X            }
  803. X            if ((tbufsize % BLKSIZE) != 0) {
  804. X                (void) fprintf(stderr,
  805. X                "%s: buffer size (%ld) not multiple of 512\n",
  806. X                argv[0], tbufsize);
  807. X                usage();
  808. X            }
  809. X            break;
  810. X
  811. X        case 'r':    if (mode != 0) {
  812. X                (void) fprintf(stderr,"%s: too many options\n",
  813. X                argv[0]);
  814. X                usage();
  815. X            }
  816. X            mode = 1;
  817. X            break;
  818. X
  819. X        case 'w':    if (mode != 0) {
  820. X                (void) fprintf(stderr,"%s: too many options\n",
  821. X                argv[0]);
  822. X                usage();
  823. X            }
  824. X            mode = 2;
  825. X            break;
  826. X
  827. X#ifdef DEBUG
  828. X        case 'd':    if (mode != 1) {    /* must be spec'd after "-r" */
  829. X                usage();
  830. X            }
  831. X            ++debug;
  832. X            break;
  833. X#endif /* DEBUG */
  834. X
  835. X        case '?':
  836. X        case 'h':
  837. X        case 'H':
  838. X        default:    usage();
  839. X        }
  840. X    }
  841. X
  842. X    if ( optind == argc )
  843. X        usage();
  844. X
  845. X    if ( optind != (argc - 1)) {
  846. X        (void) fprintf(stderr,
  847. X        "%s: extraneous data on command line ``%s''\n",
  848. X        argv[0], argv[optind + 1]);
  849. X        usage();
  850. X    }
  851. X
  852. X    switch (mode) {
  853. X        case 0:    probe_tape(argv[optind]);
  854. X            break;
  855. X        case 1:    read_tape(argv[optind]);
  856. X            break;
  857. X        case 2:    write_tape(argv[optind]);
  858. X            break;
  859. X    }
  860. X
  861. X    return 0;
  862. X}
  863. X
  864. X
  865. void
  866. probe_tape(tapedev)
  867. X    char    *tapedev;
  868. X{
  869. X    LWORD    grandttl = 0;
  870. X    LWORD    numread  = 0;
  871. X    MWORD    ssno     = 0;
  872. X    MWORD    td       = 0;
  873. X    LWORD    ttlread;
  874. X
  875. X    char    *bptr;
  876. X    char    errmsg[200];
  877. X
  878. X
  879. X    bptr = (char *) malloc(tbufsize + 4);
  880. X
  881. X    while (td >= 0) {
  882. X
  883. X        if ( (td = open(tapedev, O_RDONLY, 0)) < 0) {
  884. X        (void) sprintf(errmsg, "Cannot open tape unit %s", tapedev);
  885. X        perror(errmsg);
  886. X        exit(1);
  887. X        }
  888. X
  889. X        ttlread = 0;
  890. X
  891. X        for (;;) {
  892. X        numread = read(td, bptr, (UWORD) tbufsize);
  893. X        if (numread != tbufsize) {
  894. X            if (numread > 0) {
  895. X                ttlread += numread;
  896. X            }
  897. X            break;
  898. X        }
  899. X        ttlread += numread;
  900. X        }
  901. X
  902. X        (void) printf(STATSTR, ssno, ttlread/BLKSIZE, ttlread);
  903. X        ++ssno;
  904. X        grandttl += ttlread;
  905. X
  906. X        (void) close(td);
  907. X
  908. X        if (numread < 0) {
  909. X        (void) sprintf(errmsg, "Read error = %d", errno);
  910. X        perror(errmsg);
  911. X        td = -1;
  912. X        break;
  913. X        }
  914. X        if ((ttlread == 0) || (numread == 0)) {
  915. X        (void) printf("End of tape\n");
  916. X        td = -1;
  917. X        break;
  918. X        }
  919. X    }
  920. X
  921. X    (void) free(bptr);
  922. X
  923. X    (void) printf(GTTLSTR, grandttl/BLKSIZE, grandttl);
  924. X}
  925. X
  926. X
  927. void
  928. read_tape(tapedev)
  929. X    char    *tapedev;
  930. X{
  931. X    LWORD    grandttl = 0;
  932. X    LWORD    numread  = 0;
  933. X    MWORD    td       = 0;
  934. X    LWORD    ttlread;
  935. X
  936. X    char    *bptr;
  937. X    char    *dataptr;
  938. X    char    errmsg[200];
  939. X    char    header[HDRSIZE + 2];
  940. X
  941. X
  942. X    bptr = (char *) malloc(tbufsize + HDRSIZE + 2);
  943. X
  944. X    if (bptr == NULL) {
  945. X        (void) sprintf(errmsg,
  946. X            "Cannot allocate requested buffer size: %ld",
  947. X            tbufsize);
  948. X        perror(errmsg);
  949. X        exit(1);
  950. X    }
  951. X
  952. X    dataptr = bptr + HDRSIZE;
  953. X
  954. X    (void) sprintf(header, BUFHDR, tbufsize);
  955. X    (void) write(STDOUT, header, HDRSIZE);
  956. X
  957. X    while (td >= 0) {
  958. X
  959. X        if ( (td = open(tapedev, O_RDONLY, 0)) < 0) {
  960. X        (void) sprintf(errmsg, "Cannot open tape unit %s", tapedev);
  961. X        perror(errmsg);
  962. X        exit(1);
  963. X        }
  964. X
  965. X        ttlread = 0;
  966. X
  967. X        for (;;) {
  968. X        numread = read(td, dataptr, (UWORD) tbufsize);
  969. X        if (numread != tbufsize) {
  970. X            if (numread > 0) {
  971. X                ttlread += numread;
  972. X                (void) sprintf(header, DATHDR, numread);
  973. X                (void) strncpy(bptr, header, HDRSIZE);
  974. X                (void) write(STDOUT, bptr,
  975. X                     (UWORD) (numread + HDRSIZE));
  976. X            }
  977. X            break;
  978. X        }
  979. X        ttlread += numread;
  980. X        (void) sprintf(header, DATHDR, numread);
  981. X        (void) strncpy(bptr, header, HDRSIZE);
  982. X        (void) write(STDOUT, bptr, (UWORD) (numread + HDRSIZE));
  983. X        }
  984. X        grandttl += ttlread;
  985. X
  986. X        (void) close(td);
  987. X        (void) write(STDOUT, CLSHDR, HDRSIZE); /* close */
  988. X
  989. X#ifdef DEBUG
  990. X        if (debug)
  991. X        td = (-1);
  992. X#endif /* ifdef DEBUG */
  993. X
  994. X        if (numread < 0) {
  995. X        (void) write(STDOUT, ERRHDR, HDRSIZE); /* tape error */
  996. X        td = -1;
  997. X        break;
  998. X        }
  999. X        if ((ttlread == 0) || (numread == 0)) {
  1000. X        (void) write(STDOUT, EOTHDR, HDRSIZE); /* end of tape */
  1001. X        td = -1;
  1002. X        break;
  1003. X        }
  1004. X    }
  1005. X    (void) sprintf(header, SIZHDR, grandttl/BLKSIZE);
  1006. X    (void) write(STDOUT, header, HDRSIZE);
  1007. X
  1008. X    (void) free(bptr);
  1009. X}
  1010. X
  1011. X
  1012. void
  1013. write_tape(tapedev)
  1014. X    char    *tapedev;
  1015. X{
  1016. X    LWORD    grandttl = 0;
  1017. X    LWORD    hdrvalue;
  1018. X    LWORD    numleft;
  1019. X    LWORD    numread  = 0;
  1020. X    LWORD    numwrote = 0;
  1021. X    MWORD    process  = 1;
  1022. X    MWORD    satis    = 0;
  1023. X    MWORD    td       = -1;
  1024. X    LWORD    ttlread  = 0;
  1025. X
  1026. X    char    *bptr;
  1027. X    char    *dataptr;
  1028. X    char    *readptr;
  1029. X    char    errmsg[200];
  1030. X
  1031. X
  1032. X
  1033. X    bptr = (char *) malloc(tbufsize + HDRSIZE + 2);
  1034. X
  1035. X    if (bptr == NULL) {
  1036. X        (void) sprintf(errmsg,
  1037. X            "Cannot allocate requested buffer size: %ld",
  1038. X            tbufsize);
  1039. X        perror(errmsg);
  1040. X        exit(1);
  1041. X    }
  1042. X
  1043. X    numread = read(STDIN, bptr, HDRSIZE);
  1044. X
  1045. X    if (numread != HDRSIZE) {
  1046. X        (void) sprintf(errmsg,
  1047. X            "We gotta problem; header size wrong: %ld",
  1048. X            numread);
  1049. X        perror(errmsg);
  1050. X        exit(1);
  1051. X    }
  1052. X
  1053. X    if (*bptr == 'B') {
  1054. X        (void) sscanf(bptr + 1, SCANSTR, &hdrvalue);
  1055. X        if (hdrvalue != tbufsize) {
  1056. X        (void) sprintf(errmsg, "Buffer disagreement: R=%ld, W=%ld",
  1057. X            hdrvalue, tbufsize);
  1058. X        perror(errmsg);
  1059. X        exit(1);
  1060. X        }
  1061. X    } else {
  1062. X        perror("First header not ``B''");
  1063. X        exit(1);
  1064. X    }
  1065. X
  1066. X    dataptr = bptr + HDRSIZE;
  1067. X
  1068. X    while (process != 0) {
  1069. X
  1070. X        numread = read(STDIN, bptr, HDRSIZE);
  1071. X
  1072. X        if (numread != HDRSIZE) {
  1073. X        (void) sprintf(errmsg,
  1074. X                "We gotta problem; header size wrong: %ld",
  1075. X                numread);
  1076. X        perror(errmsg);
  1077. X        exit(1);
  1078. X        }
  1079. X        (void) sscanf(bptr + 1, SCANSTR, &hdrvalue);
  1080. X
  1081. X        switch (*bptr) {
  1082. X        case 'D':    if (td < 0) {
  1083. X                if ( (td = creat(tapedev, UMASK)) < 0) {
  1084. X                (void) sprintf(errmsg,
  1085. X                           "Cannot open tape unit %s",
  1086. X                           tapedev);
  1087. X                perror(errmsg);
  1088. X                process = 0;
  1089. X                }
  1090. X            }
  1091. X
  1092. X            numleft = hdrvalue;
  1093. X            readptr = dataptr;
  1094. X            satis   = 0;
  1095. X
  1096. X            while (satis == 0) {
  1097. X                numread  = read(STDIN, readptr, (UWORD) numleft);
  1098. X                if (numread != numleft) {
  1099. X                numleft -= numread;
  1100. X                readptr += numread;
  1101. X                ttlread += numread;
  1102. X                } else {
  1103. X                ttlread += numread;
  1104. X                ++satis;
  1105. X                }
  1106. X            }
  1107. X
  1108. X            numwrote = write(td, dataptr, (UWORD) hdrvalue);
  1109. X            if (numwrote != hdrvalue) {
  1110. X                (void) fprintf(stderr,
  1111. X                "Tape size error: %ld should be %ld\n",
  1112. X                numwrote, hdrvalue);
  1113. X                (void) close(td);
  1114. X                process = 0;
  1115. X            } else {
  1116. X                grandttl += numwrote;
  1117. X            }
  1118. X            break;
  1119. X        case 'C':    if (td < 0) {
  1120. X                if ( (td = creat(tapedev, UMASK)) < 0) {
  1121. X                (void) sprintf(errmsg,
  1122. X                           "Cannot open tape unit %s",
  1123. X                           tapedev);
  1124. X                perror(errmsg);
  1125. X                process = 0;
  1126. X                }
  1127. X            }
  1128. X            (void) close(td);
  1129. X            td = -1;
  1130. X            break;
  1131. X        case 'T':    process = 0;    /* Remote End-Of-Tape; all done */
  1132. X            break;
  1133. X        case 'S':    if (hdrvalue != (grandttl/BLKSIZE)) {
  1134. X                (void) fprintf(stderr,
  1135. X                "Grand total mismatch: %ld should be %ld\n",
  1136. X                grandttl, ttlread);
  1137. X            }
  1138. X            td = -1;
  1139. X            process = 0;
  1140. X            break;
  1141. X        case 'E':    (void) fprintf(stderr, "Remote error detected\n");
  1142. X            break;
  1143. X        default:    (void) fprintf(stderr, "Header error: %c\n", *bptr);
  1144. X            if (td >= 0) {
  1145. X                (void) close(td);
  1146. X                td = -1;
  1147. X            }
  1148. X            process = 0;
  1149. X        }
  1150. X    }
  1151. X
  1152. X    (void) free(bptr);
  1153. X}
  1154. X
  1155. void
  1156. usage()
  1157. X{
  1158. X    int    ndx = 0;
  1159. X
  1160. X    while ( usage_text[ndx] != 0 ) {
  1161. X
  1162. X        (void) fprintf( stderr, "%s\n", usage_text[ndx++] );
  1163. X    }
  1164. X    (void) fprintf( stderr, "%s\n", version + VERSKIP );
  1165. X    exit(1);
  1166. X}
  1167. END_OF_FILE
  1168. if test 11058 -ne `wc -c <'tprobe.c'`; then
  1169.     echo shar: \"'tprobe.c'\" unpacked with wrong size!
  1170. fi
  1171. # end of 'tprobe.c'
  1172. fi
  1173. if test -f 'tprobe.man' -a "${1}" != "-c" ; then 
  1174.   echo shar: Will not clobber existing file \"'tprobe.man'\"
  1175. else
  1176. echo shar: Extracting \"'tprobe.man'\" \(9992 characters\)
  1177. sed "s/^X//" >'tprobe.man' <<'END_OF_FILE'
  1178. X.TH TPROBE L "12-Feb-1992"
  1179. X.\"@(#)tprobe.man V1.0, 12-Feb-1992, Thad Floryan [ thad@btr.com ]
  1180. X.SH NAME
  1181. tprobe \- tape saveset analyzer and duplicator
  1182. X.SH SYNOPSIS
  1183. tprobe [-b
  1184. X.I n]
  1185. X.I /dev/NRTD
  1186. X.LP
  1187. tprobe [-b
  1188. X.I n]
  1189. X-r
  1190. X.I /dev/NRTD0
  1191. X| tprobe [-b
  1192. X.I n]
  1193. X-w
  1194. X.I /dev/NRTD1
  1195. X.LP
  1196. X.I [host]
  1197. tprobe [-b
  1198. X.I n]
  1199. X-r
  1200. X.I /dev/NRTD0
  1201. X|
  1202. X.ti +23
  1203. X.I [host]
  1204. tprobe [-b
  1205. X.I n]
  1206. X-w
  1207. X.I /dev/NRTD1
  1208. X.sp
  1209. X.ta +0.3i
  1210. X.in +0.3i
  1211. X.ti -0.3i
  1212. X\(bu
  1213. X.I    ``/dev/NRTDn''
  1214. is typically the "no-rewind-on-close" tape device [See
  1215. X.I OPERATING NOTES]
  1216. X.sp
  1217. X.ti -0.3i
  1218. X\(bu
  1219. X.I    ``host''
  1220. is the system-dependent clause signifying remote tape
  1221. operation [See
  1222. X.I OPERATING NOTES]
  1223. X.in -0.3i
  1224. X.SH DESCRIPTION
  1225. X.I tprobe
  1226. is a utility which succeeds duplicating boot/install tapes that are not
  1227. easily copied by other means.  One of its features is operation over a
  1228. pipeline utilizing multiple tape drives whereever they exist on a network
  1229. or a system.
  1230. X.sp
  1231. X.I tprobe
  1232. can also (indirectly) perform media conversions, though the
  1233. only verified conversions have been from QIC-120 and QIC-150 to QIC-24
  1234. and vice versa; there is no inherent limitation, so other conversions
  1235. are definitely possible.
  1236. X.sp
  1237. Another feature is that a tape may be processed without disk space being
  1238. usurped for intermediate staging.  Thus, a full 150MB tape can be duplicated
  1239. even if one's system has only, say, 20MB free.
  1240. X.sp
  1241. X.I tprobe's
  1242. basic operation reveals a tape's existing saveset layout and stored capacity,
  1243. and requires only a single tape drive for this analysis.
  1244. X.sp
  1245. X.I tprobe
  1246. was intended to be a one-time-only program, but it is useful in its present
  1247. incarnation and does solve immediate and present problems.
  1248. XFor
  1249. X.I tprobe's
  1250. raison d'etre and anecdotes, see the
  1251. X.I BACKGROUND
  1252. section.
  1253. X.SH OPTIONS
  1254. X.TP 8
  1255. X.I -b
  1256. Specifies the buffering size to help maintain streaming operation.  The
  1257. default is 65536 bytes.  A value must be stated in bytes; no abbreviations
  1258. are recognized in this version.  The buffer must be the same size at both
  1259. ends of the pipe else the "write" process will diagnose the error and abort.
  1260. X.sp
  1261. XFor 8mm EXB-8200 drives, 262144 (256KB) appears to be an optimal size.
  1262. XExperiment!
  1263. X.TP 8
  1264. X.I -r
  1265. Designates "this" process to be the tape reader and head of the pipeline.
  1266. X.TP 8
  1267. X.I -w
  1268. Designates "this" process to be a tape writer and a tail of the pipeline
  1269. X(see
  1270. X.IB tee(1)).
  1271. X.SH OPERATING NOTES
  1272. With no options (other than -b),
  1273. X.I tprobe
  1274. reads a tape and writes a brief analysis of its findings to stdout.
  1275. X.sp
  1276. The tape device should be a "no-rewind-on-close" device per the following
  1277. examples:
  1278. X.sp
  1279. X.nf
  1280. X.RS
  1281. X/dev/nrst8      SunOS 4.1.1 with a SCSI tape
  1282. X.br
  1283. X/dev/rmt4       CTIX or 3B1 with a QIC-02 drive
  1284. X.RE
  1285. X.fi
  1286. X.sp
  1287. In general, a tape should be rewound before use.
  1288. Several examples of rewinding a tape on some systems are:
  1289. X.sp
  1290. X.nf
  1291. X.RS
  1292. SunOS 4.1.1:    mt -f /dev/rst8 rewind
  1293. X.br
  1294. CTIX:           tsioctl -c rewind /dev/rmt0
  1295. X.br
  1296. X3B1:            qrewind   # (Thad's QIC-02 program)
  1297. X.RE
  1298. X.fi
  1299. X.sp
  1300. The "[host]" as shown in the
  1301. X.I SYNOPSIS
  1302. takes the forms:
  1303. X.sp
  1304. X.RS
  1305. X[rsh | remsh | rcmd] hostname
  1306. X.RE
  1307. X.sp
  1308. as appropriate for the system on which the command is issued.
  1309. Specification simply as "hostname" is permitted if /usr/hosts/MAKEHOSTS has
  1310. been previously executed and "/usr/hosts" is present in $PATH.
  1311. X.sp
  1312. Note that for remote system operation, the /etc/hosts.equiv and/or
  1313. the ~/.rhosts authentication file(s) must be previously established.
  1314. X.I tprobe
  1315. must exist within the directories specified in all one's $PATH's, especially
  1316. so for remote operation.
  1317. X.sp
  1318. Note that not all systems' and/or applications' install tapes have two
  1319. consecutive file-marks to designate end-of-tape;
  1320. X.I tprobe
  1321. will still correctly duplicate such tapes.
  1322. X.SH EXAMPLES
  1323. To duplicate a tape mounted on a remote Sun named "faraway" onto the local
  1324. Sun, assuring that all tapes are rewound before and after the operation:
  1325. X.sp
  1326. X.in +0.5i
  1327. rsh faraway mt -f /dev/rst8 rewind
  1328. X.br
  1329. mt -f /dev/rst8 rewind
  1330. X.br
  1331. rsh faraway tprobe -r /dev/nrst8 | tprobe -w /dev/nrst8
  1332. X.br
  1333. rsh faraway mt -f /dev/rst8 rewind
  1334. X.br
  1335. mt -f /dev/rst8 rewind
  1336. X.in -0.5i
  1337. X.sp
  1338. To duplicate a tape on a local Sun having two tape drives:
  1339. X.sp
  1340. X.ti +0.5i
  1341. tprobe -r /dev/nrst8 | tprobe -w /dev/nrst9
  1342. X.sp
  1343. To duplicate a tape between two remote Sun systems ("proxy" mode)
  1344. where both remote systems have link entries in /usr/hosts:
  1345. X.sp
  1346. X.ti +0.5i
  1347. host1 tprobe -r /dev/nrst8 | host2 tprobe -w /dev/nrst8
  1348. X.SH BACKGROUND
  1349. It appears there's confusion surrounding the "difficulty" making [legally
  1350. permissible] backup copies of one's boot/install tapes to assure continued
  1351. operation of one's system(s).
  1352. X.sp
  1353. Many people's attempts with
  1354. X.IB dd(1),
  1355. X.IB cat(1),
  1356. etc. have failed (even though such
  1357. attempts have worked duplicating, say, "pure" tar- or cpio-written tapes).
  1358. X.sp
  1359. The reason for the difficulty is due to the varying record sizes typically
  1360. found on boot/install tapes.  In other words, it's difficult to specify an
  1361. X.I efficient
  1362. least-common-denominator (LCD) block/record size to
  1363. X.IB dd(1)
  1364. for a "raw" duplication [ although an intelligent shell script can get around
  1365. this, using
  1366. X.IB dd(1)'s
  1367. stats ]; note programs such as
  1368. X.IB cat(1)
  1369. tend to assume constantly-fixed record sizes.
  1370. X.sp
  1371. XFor the record, the LCD for QIC tapes is 512-bytes, which is the physical
  1372. blocking size.  But if you attempt to use that size, your data will be
  1373. X``Shoe Shined'' into oblivion!  :-)
  1374. X.sp
  1375. Three representative samplings of the beginning layout of boot tapes
  1376. analyzed by
  1377. X.I tprobe
  1378. for a Sun, a CTIX, and an AT&T boot/install tape are shown below.
  1379. X"SS n" is the save-set number (a save-set being the data
  1380. between file-marks on a tape).
  1381. X"blocks" are the 512-byte physical records as written on QIC tapes.
  1382. These examples show
  1383. X.I tprobe
  1384. operation from a Sun system console:
  1385. X.sp
  1386. X.RS
  1387. X% # SunOS 4.1.1 Sun-3 SUNBIN, tape 1 of 2
  1388. X.br
  1389. X% #
  1390. X.br
  1391. X% tprobe /dev/nrst8
  1392. X.br
  1393. SS   0:     64 blocks,     32768 bytes
  1394. X.br
  1395. SS   1:     16 blocks,      8192 bytes
  1396. X.br
  1397. SS   2:   1425 blocks,    729600 bytes
  1398. X.br
  1399. SS   3:   3200 blocks,   1638400 bytes
  1400. X.br
  1401. SS   4:  14000 blocks,   7168000 bytes
  1402. X.br
  1403. SS   5:    146 blocks,     74752 bytes
  1404. X.br
  1405. SS   6:  22674 blocks,  11609088 bytes
  1406. X.br
  1407. X[...]
  1408. X.sp
  1409. X% # CTIX 6.2 MightyFrame RUNTIME/INSTALL
  1410. X.br
  1411. X% #
  1412. X.br
  1413. X% tprobe /dev/nrst8
  1414. X.br
  1415. SS   0:    128 blocks,     65536 bytes
  1416. X.br
  1417. SS   1:    768 blocks,    393216 bytes
  1418. X.br
  1419. SS   2:   1888 blocks,    966656 bytes
  1420. X.br
  1421. SS   3:   2176 blocks,   1114112 bytes
  1422. X.br
  1423. SS   4:    320 blocks,    163840 bytes
  1424. X.br
  1425. SS   5:    384 blocks,    196608 bytes
  1426. X.br
  1427. SS   6:    256 blocks,    131072 bytes
  1428. X.br
  1429. X[...]
  1430. X.sp
  1431. X% # AT&T 3B2 SVR3.2.2 LOAD 19 OS & UTILS
  1432. X.br
  1433. X% #
  1434. X.br
  1435. X% tprobe /dev/nrst8
  1436. X.br
  1437. SS   0:   4099 blocks,   2098688 bytes
  1438. X.br
  1439. SS   1:   8610 blocks,   4408320 bytes
  1440. X.br
  1441. SS   2:      3 blocks,      1536 bytes
  1442. X.br
  1443. SS   3:   1422 blocks,    728064 bytes
  1444. X.br
  1445. SS   4:   1422 blocks,    728064 bytes
  1446. X.br
  1447. SS   5:   1422 blocks,    728064 bytes
  1448. X.br
  1449. SS   6:   1422 blocks,    728064 bytes
  1450. X.br
  1451. X[...]
  1452. X.RE
  1453. X.sp
  1454. X.I tprobe
  1455. was conceived when it was realized the SunOS 4.1.1 Sun-3 SUNBIN install tape
  1456. was to be the last ever from Sun for that architecture and that a backup was
  1457. essential to prevent disaster if the tape should be "bad" when most needed
  1458. to boot into a miniroot.
  1459. X.sp
  1460. X.I tprobe's
  1461. main purpose is to read one tape and write to another over Ethernet since
  1462. systems typically possess only one tape drive.
  1463. X.sp
  1464. X.I tprobe
  1465. duplicates tapes
  1466. X.I without consuming disk space
  1467. and, as a side benefit,
  1468. indirectly converts tape media between QIC-11/-24/-120/-150/-525 within
  1469. the storage capability of the output tape.
  1470. X.sp
  1471. The first test of
  1472. X.I tprobe
  1473. was the duplication of a SunOS install tape by reading the original on a 3B1
  1474. while writing the duplicate on a CT MightyFrame, then booting and
  1475. suninstall'ing from the duplicated tape on a Sun-3/60.
  1476. X.sp
  1477. Systems on which
  1478. X.I tprobe
  1479. has been installed and tested include 3B1, CTIX, Sun-3, Sun-4, and an AT&T 3B2.
  1480. X.SH AUTHOR
  1481. Thad Floryan
  1482. X.br
  1483. thad@btr.com (OR) {decwrl,mips,fernwood}!btr!thad
  1484. X.br
  1485. X.ne 3
  1486. X.SH VERSION
  1487. The present release of
  1488. X.I tprobe
  1489. is 1.0, dated 12-Feb-1992.
  1490. X.SH FUTURE DEVELOPMENT
  1491. X.ta +0.3i
  1492. X.in +0.3i
  1493. X.ti -0.3i
  1494. X\(bu    Add double buffering (for speed) along the lines of the
  1495. X.IB ddd(1)
  1496. program posted to comp.sources.unix/Volume15 by Tapani Lindgren, with two
  1497. child processes alternating pipe I/O with tape I/O.
  1498. X.sp
  1499. X.ti -0.3i
  1500. X\(bu    Devise a method of truly copying, say, a full 150MB tape onto
  1501. three 60MB tapes.  Would require more tape "smarts" to detect EOM (end
  1502. of media) and prompting for media change.  Not certain of feasibility
  1503. due to unknown source media's genesis (e.g. tar, cpio, whatever).
  1504. X.SH CAVEATS
  1505. X.PP
  1506. This program has functioned satisfactorily for the author, but no guarantees
  1507. or warrantees are given or implied that
  1508. X.I tprobe
  1509. will be suitable for your applications; this software is distributed
  1510. X.I AS IS.
  1511. X.sp
  1512. Any error detection and correction, such as may exist, is limited to that
  1513. available with the standard system I/O calls
  1514. X.IB open(2),
  1515. X.IB read(2)
  1516. and
  1517. X.IB write(2).
  1518. X.sp
  1519. By installing
  1520. X.I tprobe
  1521. on your system, you assume all risks and liabilities for its use.
  1522. X.SH BUGS
  1523. X.PP
  1524. Internal counters and statistics are kept as "long" data;
  1525. newer tape drives whose media capacity exceeds a system's ability to
  1526. retain a tally that large will definitely be troublesome.
  1527. X.sp
  1528. X.I tprobe
  1529. assumes the user has specified a tape device as its object; anything else
  1530. as
  1531. X.I tprobe's
  1532. object will probably trigger unknown and bizarre side-effects.
  1533. X.SH SEE ALSO
  1534. All pertinent tape, mt, mtio, tsioctl, etc. commands as appropriate for
  1535. your system(s) to ascertain the correct tape device syntax and semantics
  1536. for your drive(s) operated per "no-rewind-on-close."
  1537. X.sp
  1538. The
  1539. X.IB copytape(1)
  1540. program by David S. Hayes (April 1985/July 1986) is also
  1541. worthy of your consideration.   On a system with one tape drive, it
  1542. creates a specially-formatted intermediate file whose size reflects the
  1543. tape's contents; on a two-tape-drive system it can duplicate a tape in
  1544. one pass.  Because of its intermediate file,
  1545. X.IB copytape(1)
  1546. easily produces multiple copies after a single read of the master tape.
  1547. END_OF_FILE
  1548. if test 9992 -ne `wc -c <'tprobe.man'`; then
  1549.     echo shar: \"'tprobe.man'\" unpacked with wrong size!
  1550. fi
  1551. # end of 'tprobe.man'
  1552. fi
  1553. echo shar: End of archive 1 \(of 1\).
  1554. cp /dev/null ark1isdone
  1555. MISSING=""
  1556. for I in 1 ; do
  1557.     if test ! -f ark${I}isdone ; then
  1558.     MISSING="${MISSING} ${I}"
  1559.     fi
  1560. done
  1561. if test "${MISSING}" = "" ; then
  1562.     echo You have the archive.
  1563.     rm -f ark[1-9]isdone
  1564. else
  1565.     echo You still need to unpack the following archives:
  1566.     echo "        " ${MISSING}
  1567. fi
  1568. ##  End of shell archive.
  1569. exit 0
  1570. -- 
  1571. Paul Vixie, DEC Network Systems Lab    
  1572. Palo Alto, California, USA             "Don't be a rebel, or a conformist;
  1573. <vixie@pa.dec.com> decwrl!vixie        they're the same thing, anyway.  Find
  1574. <paul@vix.com>     vixie!paul        your own path, and stay on it."  -me
  1575.