Amanda-Users

Re: to compress or not to compress ???

2003-07-04 04:56:12
Subject: Re: to compress or not to compress ???
From: Paul Bijnens <paul.bijnens AT xplanation DOT com>
To: "Michael D. Schleif" <mds AT helices DOT org>
Date: Fri, 04 Jul 2003 10:51:47 +0200
Michael D. Schleif wrote:
Also sprach Joshua Baker-LePain (Thu 03 Jul 02003 at 05:41:32PM -0400):
On Thu, 3 Jul 2003 at 4:20pm, Michael D. Schleif wrote
Also, using only amrestore, is it possible to get at individual
files/directories, or is it only a matter of restoring the entire
dump/tarball?

Yes, depending. If you use dump, you can usually pipe amrestore to 'restore -i', the interactive restore, which will let you pick and choose. If you use tar, you can do a 'tar t' to get a table of contents, and then 'tar x myfile ./mydir/myfile2' to get particular files.


This is where I'm getting lost:

    # sudo mt -f /dev/nst0 rewind

    # sudo tar tvf /dev/nst0
    tar: /dev/nst0: Cannot read: Cannot allocate memory
    tar: At beginning of tape, quitting now
    tar: Error is not recoverable: exiting now

What do you think?


First you have to realize that on a tape you can put any
sequence of bytes.  To read and write those bytes from/to
tape, it's also important that you do that with a suitable
blocksize. In theory you could read the tape with "cat", but
cat does not have a way to specify the read blocksize.  That's
why we use the "dd" command.
If you read a tape, you have to do it with a blocksize equal
or greater than the blocksize used when written.

Amanda writes your tapes with a 32k blocksize (you can
change the default blocksize in recent versions -- know your
config!)

A file on tape is any sequence of bytes.  You can put many
files on tape sequentially, each separated with a filemarker.
After the last file is an end of data marker.

The format of an amanda is as follows:
The first file is the amanda header. Then follow the different
dump images.
The first block (32k in de the default setup) contains in simple
ascii the description of what follows/
The header looks like:

  AMANDA: TAPESTART DATE 20030702 TAPE Test-01
  ^L
  ^@^@^@^@^@^....ascii nulls to fill up the rest of the blocksize

The next files are each contain a header of 1 block, that contains
the description of the next bytes:

AMANDA: FILE 20030702 sunny /space lev 0 comp N program /usr/local/bin/amgtar
 To restore, position tape at start of file and run:
        dd if=<tape> bs=32k skip=1 | /usr/local/bin/amgtar -f... -
 ^L
 ^@^@^@^@^@^@^@^@....ascii nulls to fill up the rest of the block

As you can see, amanda explains even what command you can use to
read it:  it contains a tar file, and to read it skip over the 32k
header and feed those bytes to tar.

What you should be doing was:
  mt -f /dev/nst0 rewind
  mt -f /dev/nst0 fsf 1         # skip over the tape label
  dd if=/dev/nst0 bs=32k skip=1 | tar -tvf -

If you had used software compression, add the "z" flag to gnutar.

In docs/RESTORE, you can find all the commands you need to use
an amanda tape without amanda software.

--
Paul Bijnens, Xplanation                            Tel  +32 16 397.511
Technologielaan 21 bus 2, B-3001 Leuven, BELGIUM    Fax  +32 16 397.512
http://www.xplanation.com/          email:  Paul.Bijnens AT xplanation DOT com
***********************************************************************
* I think I've got the hang of it now:  exit, ^D, ^C, ^\, ^Z, ^Q, F6, *
* quit,  ZZ, :q, :q!,  M-Z, ^X^C,  logoff, logout, close, bye,  /bye, *
* stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt,  abort,  hangup, *
* PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e,  kill -1 $$,  shutdown, *
* kill -9 1,  Alt-F4,  Ctrl-Alt-Del,  AltGr-NumLock,  Stop-A,  ...    *
* ...  "Are you sure?"  ...   YES   ...   Phew ...   I'm out          *
***********************************************************************



<Prev in Thread] Current Thread [Next in Thread>