From: ricks@odin.isc-br.com (Rick Schaeffer 99)
Newsgroups: comp.unix.amiga,comp.sys.amiga.hardware
Subject: Re: Help me duplicate a QIC tape...
Date: 9 Apr 92 03:10:53 GMT
Reply-To: ricks@odin.UUCP (Rick Schaeffer 99)
Followup-To: comp.unix.amiga
Organization: ISC-Bunker Ramo, An Olivetti Company

In article <4ppjj!c.harp@netcom.com> harp@netcom.com (Gregory O. Harp) writes:
>
>I need suggestions on how to duplicate a 150MB QIC tape using an Amiga
>3000 (running AmigaDOS 2.04) and an A3070 tape drive.  Is there any
>way to do this currently with only one tape drive?
>

Yeah...I'm not comfortable with only one copy of the master either!

To start with...you need lots of disk space!  The tape consists of 
1 short segment that contains the contents of the tape, followed by
a detail contents segment followed by n segments containing the rest
of the distribution.  What I do is as follows:

1.  Get the contents.  To do this, mount the tape and do "mt rewind" to
    be sure it's rewound.  Then do "cpio -icv </dev/rmt/4".  This will
    extract two files..."List" and "Version".

2.  Edit in the "List" file with your favorite editor.  You will see
    that there is one line for each segment.  Each begins with the
    package name as "pkg=nnnnnnn".  I suppose you could write a script
    to do this, but what I do is mangle the file until I'm left with
    lines containing *just* the package name.  Then I append the following
    to lines as the first two in the file:
      Amixlist
      Unixcontents

3.  At this point I write out the results as a file named "seglist".  The
    result of all of this should be a simple list of the segment names that
    are on the tape...including the first two.

4.  I have a little shell script called "cpdist" that looks like this:
      :
      for name in `cat seglist`
      do
      	echo "Working on segment $name"
      	dd if=/dev/rmt/4n of=$name bs=32k
      done
    Running this script creates a file for each segment on the tape whose
    name is the segment name.  It requires enough disk space to hold
    the entire tape, although I suppose you could create several seglists
    and do a piece at a time.  You would just have to be sure and run
    "mt fsf <n>" after you mount, in turn, the source and destination
    tapes in order to get them positioned.

5.  I have another little script called "dtdist" which should be obvious.
    It is identical to "cpdist" except that the "dd" line is reversed.
    ie: "dd if=$name of=/dev/rmt/4n bs=32k".  It copies the segments
    from disk to a new tape.

This works for me.  It's even pretty quick because dd is just reading raw
data and writing into a single file...so the tape never pauses until the
end of the segment.  As a fringe benefit, you can keep the segments around
on your disk in their most compact form without actually installing them.
You can also examine them and extract from them.  If you take another
look at the "List" file that is in the first segment, you will see some
interesting things there besides the segment name.  Some indicate "zcat = y"
and mean that that segment is in compressed form.  Sooo...if you wanted to
examine one of the compressed segments, for instance the "Xsrc" segment,
then do the following:
  cat Xsrc | uncompress | cpio -itv
to actually extract it into the current directory do:
  cat Xsrc | uncompress | cpio -icmduv
and so on.  Gives you a bit more freedom to choose where things land.

--
Rick Schaeffer          UUCP:  uunet!isc-br.isc-br.com!ricks
ISC-Bunker Ramo                ricks@isc-br.isc-br.com
Box TAF-C8              Phone: (509)927-5114
Spokane, WA  99220      Home:  (509)928-3533
Newsgroups: comp.unix.amiga