Copying SunOS distribution tapes

Len Evens len at rufus.bitnet
Sun Oct 15 00:23:25 AEST 1989


We also have to copy tapes because of a University wide update arrangement
in which the University gets one set of tapes for everyone.

To copy a Sun OS distribution tape, just copy all the records to disk and
then copy them back to the other  tape.   If you have lots of disk space
you can do it a tape at a time, otherwise you will have to do it one
record at a time.   The only problem I encountered was that dd couldn't
seem to get past an end of record mark on the tape so that the obvious
scheme for copying from the tape to disk did not work.  Hence, for each
record it was  necessary to rewind the tape and skip over the previously
read records to read the next  record.   This led to an  arithmetic
progression for time  so that the  time went like N squared where N is the
number of records.   Here are shell scripts I used for the second of two
tapes for the 4.0.3 update.

For  reading a 1/4 in tape  (tape 2 of the distribution).

#!/bin/sh
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
do
mt -f /dev/nrst8 fsf $i
dd bs=1024 </dev/nrst8 1>/home/len/tape/tape2/file$i 2>>/home/len/tape/tape2/r
mt -f /dev/rst8 rew
done

For writing to a 1/4 in tape.

#!/bin/sh
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
do
dd bs=1024 < /home/len/tape/tape2/file$i 1>/dev/nrst8 2>>/home/len/tape/tape2/w
done
mt -f /dev/rst8 rew

One problem in using this scheme is that you have to know the number of
records on each tape you are reading.   Fortunately, this is in the second
record on the Sun distribution tape.  You use the program
/usr/etc/install/xdrtoc to read it.   You can copy that record from the
tape (as above) but pipe the result to xdrtoc.  Also, if you don't get all
the records the first time, you  read the next ones just  by changing the
numbers since you are rewinding the tape each time anyway. 

There is a tape copying routine which may work if you have two tape drives
on one machine.   However, I couldn't get it to work with a local  1/4 in
drive and a remote 1/4 in drive another machine.  I think it may only work
with reel to reel  1/2 in tapes.

Leonard Evens                      len at math.nwu.edu
Department of Mathematics 
Northwestern University
Evanston, IL 60208
312-491-5537



More information about the Comp.sys.sun mailing list