richard wrote:
>
> Dear sir,
> I have tried the -h -c
> tar -hc 202.85.165.88._home.20001215.0
> with my file amrestored from the tape.
> Then it shows a lot of strange characters in front of my monitor for a
> long time.
> May I ask what is wrong?
>
Richard,
nothing is going wrong. Alexandre has already sent you the right
options. Let me expand a little on the subject, so that everything
becomes crystal clear:
Each one of the files AMANDA writes, like your
202.85.165.88._home.20001215.0, has a header in the first 32K, which
does not belong to the file. The header contains some information about
the file, the restore command to restore it etc.
Now, the "problem" in your case is to know how you got this file. There
are some cases:
1) AMANDA worked as usual and wrote the file on tape. You have
positioned the tape to the start of the file (I am lazy, so I use "mt -f
<tape device> asf <number of the file on tape (i.e. 1, 2, 3, ...)>").
Let me say it again: positioning at the start of the right file is
important, otherwise you will get gargage. You use amrestore *without
the -h option* and you get a file on your disk. Since you didn't use
"-h" in amrestore, the header is already stripped off the file, so the
file on your disk must be read *without* the "skip=1" parameter (which
means "skip one block", which again, in connection with "ibs=32k", means
"skip 32K") to dd:
dd if=202.85.165.88._home.20001215.0 ibs=32k obs=32k | gzip -dc | tar
-tf -
2) If you used amrestore *with* "-h", then the header is there, so you
must use (see the "skip=1" here?)
dd if=202.85.165.88._home.20001215.0 ibs=32k obs=32k skip=1 | gzip -dc |
tar -tf -
3) You don't use amrestore. You read the file directly from tape. Then
you have again to position the tape at the start of the file and do:
dd if=<your tape device (e.g. /dev/whatever)> ibs=32k obs=32k skip=1 |
gzip -dc | tar -tf -
So you must use "skip=1" here.
4) AMANDA did not find your tape device and wrote everything to the
holding disk. You read one of those file from the holding disk, say
202.85.165.88._home.20001215.0. Then you must do
dd if=202.85.165.88._home.20001215.0 ibs=32k obs=32k skip=1 | gzip -dc |
tar -tf -
exactly as in case 2), because AMANDA wrote a 32K header at the start of
each file (exactly as she would do if the file were to go to tape,
instead of the holding disk. For AMANDA this makes no difference).
By the way, if your 202.85.165.88._home.20001215.0 file *has* a header,
you can read it using:
dd if=202.85.165.88._home.20001215.0 ibs=32k obs=32k count=1 | gzip -dc
| tar -tf -
All this, of course, assuming it is a tar file, otherwise you would have
to use the "restore" program of your OS (restore, ufsrestore, ...) in
place of tar in the pipe - and assuming that you used compression,
otherwise you don't need the gzip part of the pipe.
Note: the type of "DUMP" program you use is specified in your
amanda.conf, in the dumptypes. You have to see what dumptype was
specified in the file "disklist" for /home, then look in amanda.conf and
recursively work up all the dumptypes the one you use includes in its
definition. It is totally irrelevant to the question, which programm is
*installed* on your *server*, tar, dump, or both - the question is,
which one is *used* by the *client* to create the backup.
--
Regards
Chris Karakas
Don´t waste your cpu time - crack rc5: http://www.distributed.net