>According to the docs, the method is just :
>
>mt -f /dev/nst0 rewind
>dd if=/dev/nst0 bs=32 skip=1 | tar xv -
>
>but when I use the tar (yes, it's gtar, really) it complains
>that the file is not a valid archive.  ...

You skipped a step.  You have to position the tape with "mt fsf" to the
proper file between doing the "rewind" and the "dd".  What you did above
was read the tape label (the first file on the tape) and pass an empty
image to gtar.

The obvious question is then, "how do I know what file has the image
I need".  For that, you'll have to either have an offline listing of some
type from each Amanda run (such as setting up lbl-templ in amanda.conf
to print a report, running amtoc and sending that file to an alternate
machine, etc), or you can scan the tape(s) and generate a catalogue
(the following ksh code is untested):

  mt -f /dev/nst0 rewind
  integer file=0
  while true
  do
    echo === $file ===
    if dd if=/dev/nst0 bs=32k count=1 > /tmp/header.$$
    then
      sed 1q < /tmp/header.$$
      ((file = file + 1))
    else
      break
    fi
  done
  rm -f /tmp/header.$$

>Jer

John R. Jackson, Technical Software Specialist, [EMAIL PROTECTED]

Reply via email to