Re: Copying tar archives/tarballs to tape
- From: Jim Howes <sewoh.mij@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 May 2006 13:04:33 +0100
Ben Tisdall wrote:
Stephen Patterson wrote:
On Tue, 23 May 2006 07:54:35 GMT, Ben Tisdall wrote:
Bit of a tape noob, need to copy some big tarballs from disk to tape
for someone.
Sure, but it seemed a better idea to get the data on tape as if I'd done
tar cvf /dev/nst0 mybigdirectory
You may want to play about with the block size arguments in tar to find
something more suitable for your drive. Some tape drives, when written to in
the 'wrong' block size, can be picky and/or extremely slow, especially QIC tapes
which get hopelessly slow if they have to keep stopping and starting.
The default block size for tar is 20 x 512 = 10240. Some tape drives leave a
large gape between blocks, therefore bigger blocks = fewer gaps = more capacity.
Some apply error correction only on a per-block basis, so larger blocks = less
error correction available in relation to amount of data = more susceptibility
to errors. This does not apply to all tapes.
Most tar implementations can pipe through gzip, so you can use the 'z' (or 'j'
for bzip2) flag when writing to tape, but bear in mind that compression uses CPU
time, which slows down the flow of data to the tape, and may cause the tape
drive to keep stopping and starting (and hence get _really_ slow). In such
cases, changing block sizes, and/or piping the output of tar through some sort
of buffering program.
In answer to your original question though, you are looking for dd (Data Dump).
Simple case:
dd if=<input file> of=<output file>
In your case <output file> is /dev/nst0
In addition, you probably want to specify a block size. Tar's default is 20 x
512 bytes = 10240. To use that, specify bs=10240
e.g.
dd if=myarchive.tar.gz of=/dev/nst0 bs=10240
To append to an existing tape, rather than overwrite it at the start, use
mt -f /dev/nst0 seod
to wind forward to the current end-of-data. To rewind and eject, use
mt -f /dev/nst0 offline
(Never a good idea to eject a QIC tape without rewinding it. Definitely a good
idea to retention it too, with mt -f /dev/nst0 reten)
If the target system does not have GNU tar, or a really old version that does
not support it, you can always use dd in reverse to recover the file from the
tape, gunzip/bunzip2 it, and then use tar to unpack it from disk.
Tapes are fun. Anyone who put the system pagefile on the TU58 drive on their
VAX will agree. (For various values of fun)
Jim
.
- References:
- Copying tar archives/tarballs to tape
- From: Ben Tisdall
- Re: Copying tar archives/tarballs to tape
- From: Stephen Patterson
- Re: Copying tar archives/tarballs to tape
- From: Ben Tisdall
- Copying tar archives/tarballs to tape
- Prev by Date: Re: Copying tar archives/tarballs to tape
- Next by Date: Any thoughts experiences with Acoustic Energy’s Wi-Fi radio?
- Previous by thread: Re: Copying tar archives/tarballs to tape
- Next by thread: Re: Copying tar archives/tarballs to tape
- Index(es):
Relevant Pages
|
|