SUMMARY: dd utility that spans multiple volumes

From: Ron Henderson (rwh@lightnet.com)
Date: Tue Jan 26 1993 - 17:38:46 CST


Sun Managers:

Thank you for all that responded!

Original question:

>Does anyone out there know of a tape utility that uses "dd" to span multiple
>tape volumes.
>
>The system consists of a MP670 server which has attached multiple
>HP-88780 1/2" tape drives. If you "dd" a file to the 1/2" drive that is larger
>in size than the 1/2" tape, "dd" just stops at the End Of Tape (EOT) and
>reports the number of records plus partial written. I would like to find a
>utility that prompts for removing and inserting the next tape to continue
>writing.

Responses:

Some people suggested ftp archive sites for various programs like "ddd"
and "multivol". The best answer came from Tom Poage (tfpoage@ucdavis.edu)
who wrote a script to handle this problem. I have included his script:

======================================================================
#!/bin/sh
# Copy a data base backup to tapes.
# Tom Poage (tfpoage@ucdavis.edu)
# UCDMC Clinical Engineering, June 1991.

INPUT=/usr3/bakfile
OUTPUT=/dev/rst8

set - `ls -l $INPUT`
BYTES_LEFT=$4 # file size

/usr/etc/renice 15 -p $$ > /dev/null 2>&1

BLKSIZ=8192
BLKS_1020FT=13000
BLKS_600FT=7500

exec < $INPUT

while expr $BYTES_LEFT \> $BLKS_600FT \* $BLKSIZ > /dev/null
do
        echo ''
        echo -n 'Insert a 1020 foot tape RETURN>'
        read junk < /dev/tty
        expr $OUTPUT : '/dev/n\{0,1\}rst' > /dev/null && mt -f $OUTPUT rewind
        echo "dd of=$OUTPUT bs=$BLKSIZ count=$BLKS_1020FT"
        dd of=$OUTPUT bs=$BLKSIZ count=$BLKS_1020FT
        BYTES_LEFT=`expr $BYTES_LEFT - $BLKS_1020FT \* $BLKSIZ`
        expr $OUTPUT : '/dev/n\{0,1\}rst' > /dev/null && mt -f $OUTPUT rewind
done

if [ $BYTES_LEFT -gt 0 ]
then
        echo ''
        echo -n 'Insert a 600 foot tape RETURN>'
        read junk < /dev/tty
        expr $OUTPUT : '/dev/n\{0,1\}rst' > /dev/null && mt -f $OUTPUT rewind
        echo "dd of=$OUTPUT bs=$BLKSIZ count=$BLKS_600FT"
        dd of=$OUTPUT bs=$BLKSIZ count=$BLKS_600FT
        expr $OUTPUT : '/dev/n\{0,1\}rst' > /dev/null && mt -f $OUTPUT rewind
fi

echo ''
echo 'Done.'

exit $?
==========================================================================

To restore:

        dd if=/dev/tape bs=$BLKSIZ > restoreFile
        dd if=/dev/tape bs=$BLKSIZ >> restoreFile
        dd if=/dev/tape bs=$BLKSIZ >> restoreFile
        ...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    // // // // // ////////// //////////
   // // //////// //// // // //
  // ** ////// ////// // // // // //////// //
 // // // // // // // // //// // //
////////// // ////// // // ///// // // ////////// //
                   //
              //////

                                --- Ron Henderson (rwh)
                                rwh@lightnet.com
                                LightNET, Inc. - A UNIX and Networks Company



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:25 CDT