Summary: how to tar to a remote tape device

From: Kirkland, Mike # IHTUL (mike.kirkland@ndchealth.com)
Date: Tue Jul 23 2002 - 10:55:18 EDT


Thanks to everyone for the quick responses; Dr Thomas Blinn, Jerry Butler,
George Gallen, Kai Grunau and Oisin McGuinness.

I did have an error in my original question as caught by the responsers.
Added below are their answers and my question.

> Hi everyone,
>
> How do you tar to a remote tape device?
>
> I have a directory /data5/p/tmp on a local box, catdog. This directory
> contains about 24 gigs of files (8 files from 1-4 gigs in size). I want to
> tar this to another server's tape drive; doggie:/dev/tape/tape0_d1
>
> I tried the following, but it is way too slow:
>
> catdog> rsh doggie dd of=/dev/tape/tape0_d1 | tar cvf - /data5/p/tmp
>
> Any suggestions or advice is appreciated.

You have the pipe backwards:

        tar cvf - /data5/p/tmp | rsh doggie dd of=/dev/tape/tape0_d1

To make it faster, you need to block the tar output and block the
writes to the tape:

        tar -b32 -cvf /data5/p/tmp | rsh doggie dd of=/dev/tape/tape0_d1
bs=64k

for instance, although you also need to experiment with reading it
back from the remote system.

You will do reasonably well even if you don't block the tar output,
but do block the tape writes. The tape writes will usually be the
bottleneck in such an arrangement.

Tom

   Dr. Thomas P. Blinn + Tru64 UNIX Software + Hewlett-Packard Company
 Internet: tpb@zk3.dec.com, thomas.blinn@compaq.com, thomas.blinn@hp.com
  110 Spit Brook Road, MS ZKO3-2/W17 Nashua, New Hampshire 03062-2698
   Technology Partnership Engineering Phone: (603) 884-0646
     ACM Member: tpblinn@acm.org PC@Home: tom@felines.mv.net

  Worry kills more people than work because more people worry than work.

      Keep your stick on the ice. -- Steve Smith ("Red Green")

     My favorite palindrome is: Satan, oscillate my metallic sonatas.
                                -- Phil Agre, pagre@alpha.oac.ucla.edu

     Yesterday it worked / Today it is not working / UNIX is like that
                        -- apologies to Margaret Segall

  Opinions expressed herein are my own, and do not necessarily represent
  those of my employer or anyone else, living or dead, real or imagined.
 =================
>From Jenny Butler

Mike,
    This is not original - a coworker set it up - but this is what we used
on
one system:

(gtar czf - . | rsh $BACKUP_DEST_NODE dd of=$BACKUP_DEST_DATA_FILE)
> $BACKUP_DEST_DATA_LOG 2>&1

========
>From George Gallen

I use:

tar cvbf 20 - $1 $2 $3 $4 $5 $6 $7 $8 | rsh lserver1 dd of=/dev/st0 obs=20

and

rsh -n lserver1 dd if=/dev/st0 ibs=20b | tar xvbf 20 - $1 $2 $3 $4 $5 $6 $7
$8

try adding the -n switch to rsh, I believe that was where my problem was.
Also, where are you starting from? are you entering this command from doggie

or catdog? It looks like you have your dd & tar reversed.

George

========
from Kai Grunau

tar -cvf - . | rsh doggie dd of=/devtape/tape0_d1 bs=10240

=====
from Oisin McGuinness

What you have written:

catdog> rsh doggie dd of=/dev/tape/tape0_d1 | tar cvf - /data5/p/tmp

doesn't do anything; the dd on the remote host will wait forever
for input (of specifies output file, so input defaults to stdin), and the
tar cvf - creates output but it doesn't go to input anywhere.

Did you intend:

catdog> tar cvf - /data5/p/tmp | rsh doggie dd of=/dev/tape/tape0_d1

?
This should have written data, but the blocking might not be optimal;
tar's blocking factor is 20, whereas dd's block size is 512bytes; you
can improve by arranging for the blocking of dd to match that of tar output
by setting bs=10240. That should help.

You could also consider doing a compression on the creation side, followed
by a reblocking before feeding to rsh. (However if your network is fast
and your drive does hardware compression, it might not help.)

catdog> tar cvf - /data5/p/tmp | compress -c - | dd bs=10240 | rsh doggie
"dd bs=10240 of=/dev/tape/tape0_d1"

Hope this helps...



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:48:46 EDT