How do I write to a tape with the 'tapewrite' command?

Writing a tape with tapewrite

In much the same manner that taperead will read a raw data stream from a tape, tapewrite will accept a raw data stream from another application’s standard output and write it onto tape.
Since the default archive utilities are not tape aware under OS X, the TOLIS Tape Tools tapewrite utility provides the mechanism required to enable these commands to write to tape.

An example session using tar to backup the /Users directory under OS X looks like:

tar –cvf - /Users | tapewrite

Notice that, like in reading a tape, tar’s –f argument is ‘-‘, or stdout in the case of writing an archive.

The same conditions apply to writing archives using tapewrite that we mentioned in our discussion of taperead.

The main thing to keep ion mind is that the default I/O buffer used in tapewrite should match the buffer used by the archive utility. Therefore, if you boost tar’s buffer size with the –b option, you should also provide the appropriate value to tapewrite using the –b option:

tar –cvb 128 –f - /Users | tapewrite –b 65536

Also, because of the raw nature in which tapewrite processes your data, you can pretty much use it with any tool’s standard output. While we wouldn’t necessarily recommend this use, you could actually combine the dd command with tapewrite to create an image of your primary disk drive on tape:

dd if=/dev/rdisk0 bs=1024 | tapewrite –f ntape0