Archived Data Recovered with MTLIB by N. A. Bourgeois, Jr. Recently a client came to me with an old archive mag tape and requested that I recover some data from it. The label on the reel indicated that the tape was written by ROLLIN. Some of you other old timers may remember it. ROLLIN was a utility on DEC's DOS/Batch operating system and later adapted by Michael Levine to load under RT-11. I tried to use the copy of ROLLIN on the clients system, a PDP-11/34 running RT-11 V5.0 and having two tape drives, but was unable to read the tape on either drive. ROLLIN would not even produce a directory. However, I could get the tape to skip past files. So I positioned the tape to start reading the desired file and issued the ROLLIN command to read the file without rewinding and searching. No luck, ROLLIN still would not read the tape. During the course of these efforts I verified that the copy of ROLLIN was functional by writing to and then reading from a scratch tape. Since this particular client was licensed to use MTLIB, I turned to it. First, I ran MTLIB's TAPLOG utility (Figure 1) to obtain a detailed record of the structure of the tape. An abreviated and annotated copy of this log is given in Figure 2. Archived Data Recovered with MTLIB PAGE 2 Since the file the client wished to recover was the third one from the start of the tape, I used MTLIB's MTAPE utility to space forward first past two EOF marks and then past two records. This positioned the tape just before the first of 300 8192-byte data records. Next, I spent twenty minutes or so writing, compiling, and linking the first draft of MTLIB's latest utility, TAPROL (Figure 3), to read the file. Execution of TAPROL recovered the data for the client. The recovered file turned out to be a 4800-block (RK05) disk image. Then, access to his data was obtained using the RT-11 MOUNT command. The time from initial request to delivery of the data to the client was just under two hours. Both ROLLIN and RT-11 consume the computer, only one user may be active. Once, I abandoned further attempts to use ROLLIN, I performed the task at hand under TSX-Plus without any further interference with the clients normal use of his machine. Figure 1, TAPLOG.FOR. PROGRAM TAPLOG C C Copyright (C) 1984 NAB Software Services, Inc. The copyright owner grants permission to copy this software provided that the above copyright notice is included. This software may not be sold or used in any commercial product. C C Author: N. A. Bourgeois, Jr. C C Sample application program for MTLIB. C C Read a magnetic tape and log the record number and the number of C bytes in each record. A count of zero bytes indicates a tape C mark. The tape may be in any arbitrary format and code. The C output is sent to the file, DK:TAPLOG.DAT. The program is Archived Data Recovered with MTLIB PAGE 3 Figure 1, TAPLOG.FOR, continued C terminated when two consecutive tape marks are encountered. The C tape is assumed to be mounted on device, MT0:. C C Edit record: C C 16-Aug-84: Original creation. C 22-Oct-84: Added copyright notice. C DIMENSION BUFFER(16384), MTUNIT(4) C INTEGER IBRC, IRET, EOFFLG, LUN, RCDNUM, READ, REWIND C LOGICAL*1 BUFFER, MTUNIT C DATA IBRC/16384/, EOFFLG/0/, LUN/30/, RCDNUM/0/, READ/1/, * REWIND/7/ DATA MTUNIT/"115,"124,"060,"000/ C 10 FORMAT (' TAPLOG: 84h29a',/) 12 FORMAT (' Record Byte',/,' Number Count',/) 14 FORMAT (' ',I6,' ',I6) 16 FORMAT ('+',2I6) 18 FORMAT (' TAPLOG: All done',/) C TYPE 10 CALL MTFOR (MTUNIT,REWIND) OPEN (ACCESS='SEQUENTIAL',NAME='DK:TAPLOG.DAT',UNIT=LUN) WRITE (LUN,12) C 100 CONTINUE RCDNUM = RCDNUM + 1 CALL MTFOR (MTUNIT,READ,IBRC,BUFFER,IRET) TYPE 16,RCDNUM,IRET WRITE (LUN,14) RCDNUM,IRET IF (IRET .GT. 0) EOFFLG = 0 IF (IRET .EQ. 0) EOFFLG = EOFFLG + 1 IF (EOFFLG .EQ. 2) GO TO 110 GO TO 100 C 110 CONTINUE CALL MTFOR (MTUNIT,REWIND) CLOSE (UNIT=LUN) TYPE 18 CALL EXIT C END Figure 2, TAPLOG.DAT. Record Byte Number Count 1 14 ! DOS/Batch file label record. 2 512 ! Bootstrap for the mag tape. Archived Data Recovered with MTLIB PAGE 4 Figure 2, TAPLOG.DAT, continued 3 14336 ! ROLLIN memory image. 4 512 ! Reel label record. 5 8192 ! . ! 300 data records. 304 8192 ! 305 0 ! Tape EOF mark 306 14 ! 307 512 ! 308 8192 ! Apparantly ROLLIN was reexecuted 309 14 ! after an unsuccessful initial 310 512 ! attempt to write this file without 311 8192 ! repositioning the tape. . ! 610 8192 ! 611 0 ! EOF. 612 14 ! File label record. 613 512 ! Reel label record. 614 8192 ! . ! Data records of desired file. 913 8192 ! 914 0 ! EOF 915 14 916 512 917 8192 . 1216 8192 1217 0 1218 14 1219 512 1220 8192 . 1519 8192 1520 0 1521 14 1522 512 1523 8192 . 1768 8192 1769 3072 1770 0 1771 14 1772 512 1773 8192 . 2032 8192 2033 3072 2034 0 2035 14 2036 512 2037 8192 . 2308 8192 2309 3072 2310 0 2311 14 Archived Data Recovered with MTLIB PAGE 5 Figure 2, TAPLOG.DAT, continued 2312 512 2313 8192 . 2602 8192 2603 3072 2604 0 ! EOF. 2605 0 ! EOF, indicating logical EOT. Figure 3, TAPROL.FOR. PROGRAM TAPROL C C Copyright (C) 1984 NAB Software Services, Inc. The copyright owner grants permission to copy this software provided that the above copyright notice is included. This software may not be sold or used in any commercial product. C C Author: N. A. Bourgeois, Jr. C C Sample application program for MTLIB. C C Read an ROLLIN disk image from a ROLLIN tape mounted on drive MT0 C to a logical device. The file name of the logical device file is C TAPROL.DSK. The tape structure may be determined with TAPLOG. C The tape may be prepositioned with MTAPE. The MOUNT command may C be used to access the recovered disk image. C C Edit Record: C C 26-Nov-84: Original creation. C 28-Nov-84: Added request for input of the total number of records C to read and zero fill of any short records. C DIMENSION * BUFFER(8192), ! I/O data buffer. * MTUNIT(4) ! tape drive unit name. C INTEGER * BYTCNT, ! number of bytes per tape record. * LUN, ! output device logical unit number. * RCDNO, ! record number in output file. * RDCNT, ! number of bytes read from tape. * READ, ! mag tape read function. * TOTRCD ! total number of tape records to read. C LOGICAL*1 * BUFFER, * MTUNIT C DATA * BYTCNT /8192/, * LUN /30/, Archived Data Recovered with MTLIB PAGE 6 Figure 3, TAPROL.FOR, continued * MTUNIT /"115,"124,"060,"000/, * READ /1/ C 1 FORMAT (/,' MTUNIT: 84k28a',//) 2 FORMAT (/,' MTUNIT: All done',//) 10 FORMAT ('+',I6,I6) 11 FORMAT (I5) C TYPE 1 CALL GTLIN (BUFFER,'Enter the number of records to copy') I = LEN (BUFFER) DECODE (I,11,BUFFER) TOTRCD OPEN (ACCESS = 'DIRECT', * MAXREC = TOTRCD, * NAME = 'DK:TAPROL.DSK', * RECORDSIZE = BYTCNT/4, * TYPE = 'NEW', * UNIT = LUN) C DO 100 I = 1,TOTRCD RCDNO = I CALL MTFOR (MTUNIT,READ,BYTCNT,BUFFER,RDCNT) TYPE 10,RCDNO,RDCNT IF (RDCNT .EQ. BYTCNT) GO TO 90 DO 80 J = RDCNT+1,BYTCNT BUFFER(J) = 0 80 CONTINUE 90 CONTINUE IF (RDCNT .EQ. 0) GO TO 110 WRITE (LUN'RCDNO) BUFFER CONTINUE 100 CONTINUE C 110 CONTINUE CLOSE (UNIT=LUN) TYPE 2 CALL EXIT END ******************************************************************* * N. A. Bourgeois, Jr. is the president of NAB Software Services, * * Inc., PO Box 20009, Albuquerque, NM 87154, (505) 298-2346. * *******************************************************************