The SCP PC User Guide: Using tapes over the network


For any of this to work, you must have your ssh RSA key set up and authorized on any relevant computers (i.e. where the disk is mounted, and where the tape drive is). You must be running an ssh-agent with this key authorized. If you don't understand any of this, then don't write tapes over the network; ask somebody who does understand it to help you.

For more information on setting up ssh, see the SCP PC user guide section on ssh.


There is a tape drive on one computer (for example, milano). You want to read a tape in that drive, writing the output to a disk on another computer (for example, ajanta). If milano crossmounts the ajanta disk as an NFS partition, then no problem: just cd to the right place on milano, read the tape on milano, and be happy. If it doesn't, then try using the following command on ajanta

(ssh milano dd if=/dev/nst0 bs=10240) | tar xvf -

where /dev/nst0 is the device of the tape drive on milano.


Suppose, in the above example, you had a stack of files on ajanta you wanted to package into a tar file into the tape on milano. In this case, you'd use the following command on ajanta:

tar cvf - | ssh milano dd of=/dev/nst0 bs=10240

Block Sizes

Note the bs=10240 parameter in the examples above; that makes the tape write with the default (for Linux) blocking factor that you would have gotten by default if you'd written to the tape directly by running tar on milano. It's not necessary when reading the tape directly with tar (i.e. not trying to go across two computers), because most tape drives and systems are capable of autodetecting block sizes.

Sometimes, tapes will be written on other operating systems, or with explicit block sizes. (FITS files written with IRAF, for instance, have a very specific blocking factor.) When this happens, you may need to use a "bs" parameter on the dd command for both reading and writing, and you may also need to use a "b" parameter on the tar command. About the best I can say is, good luck.

Last updated: 2000-August-30