UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 20.5 Using tar to a Remote Tape Drive Chapter 20
Backing Up Files
Next: 20.7 Creating a Timestamp File for Selective Backups
 

20.6 Writing a Tape Drive on a Remote Machine

[Bruce Barnett introduces this topic in article 20.5. -JP]

In news posting <5932@tahoe.unr.edu> malc@equinox.unr.edu (Malcolm Carlock) asked how to make tar write a remote tape drive via rsh (1.33) and dd (35.6). Here's the answer:

% tar cf - . | rsh foo dd of=/dev/device obs=20b

Be forewarned that most incarnations of dd are extremely slow at handling this.

What is going on? This answer requires some background:

If a blocking factor of 2 is acceptable, and if cat forces 1024-byte blocks (both true in some cases), you can use:

% tar cf - . | rsh otherhost "cat >/dev/device"

but this depends on undocumented features in cat. In any case, on nine-track tapes, since each gap occupies approximately 0.7 inches of otherwise useful tape space, a block size of 1024 has ten times as many gaps as a block size of 10240, wasting 9x1600x0.7 = 10 kbytes of tape at 1600 bpi, or 32 times as many as a size of 32768, wasting 31x6250x0.7 = 136 kbytes of tape at 6250 bpi.

I say "approximately" because actual gap sizes vary. In particular, certain "streaming" drives (all too often called streaming because they do not - in some cases the controller is too "smart" to be able to keep up with the required data rate, even when fed back-to-back DMA requests) have been known to stretch the gaps to 0.9 inches.

In general, because of tape gaps, you should use the largest record size that permits error recovery. Note, however, that some olid [2] hardware (such as that found on certain AT&T 3B systems) puts a ridiculous upper limit (5K) on tape blocks.

[2] Go ahead, look it up... it is a perfectly good crossword puzzle word. :-)

- CT in comp.unix.questions on Usenet, 3 April 1991


Previous: 20.5 Using tar to a Remote Tape Drive UNIX Power ToolsNext: 20.7 Creating a Timestamp File for Selective Backups
20.5 Using tar to a Remote Tape Drive Book Index20.7 Creating a Timestamp File for Selective Backups

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System