This section describes some simple uses of tar
and mt
.
ftape
Writing an archive to a tapeYou can use `tar
', `dd
', `cpio
', and
`afio
'. You will need to use `mt
' to get the full potential
of your tapes and the ftape
driver. For a start I'd recommend using
`tar
', as it can archive lots of directories and let you pick out
seperate files from an archive. I have been told that cpio
creates
smaller archives and is more flexible than tar
, but I haven't tried
it myself. `afio
' creates backups where each file is compressed
individually and then concatenated. This will allow you to access the files
``after'' the point of the error. If you use gzip
ped tar
files, all data after the point of the error is lost! (to me, this is a pretty
good reason for NOT using compression on backups).
To make a backup of your kernel source tree using tar
, do this
(assuming you have the sources in /usr/src/linux
):
cd /usr/src
tar cf /dev/ftape linux
This will not compress the files, but gives you a smoother tape run. If you
want the compression (and you've got tar
1.11.2), you just include
the -z
flag(*), eg: `tar czf /dev/ftape linux
'
For further instructions on how to use tar
, dd
and
mt
look at the man pages and the texinfo files that comes with the
respective distributions.
(*) tar
assumes that the first argument is options, so the
`-
' is not necessary, i.e. these two commands are the same: `tar
xzf /dev/ftape
' and `tar -xzf /dev/ftape
'
OK, let us restore the backup of the kernel source you made in section Writing an archive to a tape above. To do this you simply say
tar xf /dev/ftape
If you used compression, you will have to say
tar xzf /dev/ftape
When you use compression, gzip
will complain about trailing garbage
after the very end of the archive (and this will lead to a `broken pipe'
message). This can be safely ignored.
For the other utilities, please read the man page.
tar has an option (-d
) for detecting differences between two
archives. To test your backup of the kernel source say
tar df /dev/ftape
If you do not have the man page for tar
, you are not lost (yet); tar
has a builtin option list: try `tar --help 2>&1 | more
'
tar
file on a tapeTo put more than one tar
file on a tape you must have the mt
utility. You will probably have it already, if you got one of the mainline
distributions, e.g.\ Slackware or Debian.
tar
generates a single Tape ARchive (that's why it is called
`tar
') and knows nothing about multiple files or positioning of a
tape, it just reads or writes from/to a device. mt
knows everyting
about moving the tape back and forth, but nothing about reading the data off
the tape. As you might have guessed, tar
and mt
in
conjunction, does the trick.
By using the nrft[0-3]
(nftape
) device, you can use
`mt
' to position the tape the correct place (`mt -f /dev/nftape
fsf 2
' means step over two ``file marks'', i.e.\ tar
files) and
then use tar
to read or write the relevant data.
``Is there a way to extend an archive -- put a file on the tape, then later, add more to the tape?''
No. The tar
documentation will tell you to use `tar -Ar
',
but it does not work. This is a limitation of the current ftape
driver.
Since a tape does not have a ``filesystem'' on it, you do not mount / unmount
the tape. To backup, you just insert the tape and run your `tar
'
command (or whatever you use to access the tape with).
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter