Amanda-Users

SOLVED - Re: Recover info from an amanda tape

2003-04-07 21:37:08
Subject: SOLVED - Re: Recover info from an amanda tape
From: Jimmy <jimmy AT v2k DOT ca>
To: amanda-users AT amanda DOT org
Date: 07 Apr 2003 20:06:44 -0400
On Mon, 2003-04-07 at 15:19, Jean-Francois Malouin wrote:

> > I tried simply doing a:
> > tar -xvf /dev/st0 -b 128
> > 
> > After MANY hours, it ended with:
> > tar: Unexpected EOF in archive
> > tar: Error is not recoverable: exiting now
> 
> you have to skip the 1st 32k:
> 
> dd if=/dev/nst0 bs=32k skip=1 | tar xvf -
> 
Thank you very much for the responce!

Just in case someone else needs this info, I just want to recap what I
did.  (Actually what I am doing, tapes are not the fastest things on
earth)  :)

I tried the above but the tape really doesn't like 32k blocks.  With 32k
blocks, I was getting:

dd: reading `/dev/nst0': Cannot allocate memory
0+0 records in
0+0 records out

So I did the same thing with 64k blocks and it got reading.. :)  The
exact command I used was:
dd if=/dev/nst0 bs=64k skip=1 | tar -x "*spool/20020330/fileserv*" -vf -

But this failed like before.  BUT...  You said to use the norewind tape
device.  And with some fiddling that did it.  I started looking through
the tape like this
mt -f /dev/nts0 seek 10000
dd if=/dev/nst0 bs=64k skip=1 | tar -tvf -

This started listing what was on the tape at that point, then I did
ctrl-c to stop it and looked further:
mt -f /dev/nts0 seek 20000
dd if=/dev/nst0 bs=64k skip=1 | tar -tvf -

I ended up finding what I was looking for at seek 60000, so I just
replaced tar -tvf with tar -xvf and VOILA!  :)  It is not extracting
exactly what I need from the archive.

Thank you so very much for pointing out to me to use the norewind
device!  :)

HAVE A GREAT DAY!!!
Jimmy


> I hope you used a norewind device
> otherwize your screwd. 
> Run this shell script with the norewind tape device as argument, 
> it will tell you what's on the tape if any. 
> 
> #!/bin/sh
> TAPEDEV=$*
> mt -f $TAPEDEV rewind
> while mt -f $TAPEDEV fsf 1 ; do 
>   dd if=$TAPEDEV bs=32k count=1 | head -1
>   sleep 1
> done
> 
> 
> good luck,
> jf
> 
> > 
> > But I did get two directories:
> > indexes
> > spool
> > 
> > My indexes directory listing looks like this:
> > 20020318
> > 20020319
> > 20020320
> > 20020321
> > 20020322
> > 20020329
> > 20020330
> > 20020401
> > 20020402
> > 20020403
> > 
> > And I know (from the label on the tape) there was a full backup done on
> > Mar 30 (20020330).  When I dig down into the index directory, I can find
> > the idx file with the files I need:
> > indexes/20020330/fileserv/FILESERV_200203300505_export_home.idx
> > 
> > So I look in the spool directory and figure out the last file that was
> > extracted was from the day before 20020329.
> > 
> > Thinking something went wrong along the way, I did:
> > dd if=/dev/st0 of=fileserv.tar bs=64k
> > 
> > I end up with a 5 gig tar file.  When I try to extarct the file I need I
> > get the same EOF error.  
> > 
> > So I am assuming when you do a full backup with amanda, it does
> > something different.  I installed amanda and tried using amrestore and
> > am recover, but to no avail.  I cannot get the syntax correct to get
> > them to do anything.
> > 
> > When I view the contents of the tar, it is in this format: 
> > -rw-r--r-- backup/backup 14852500 2002-03-18 03:35:16 
> >  spool/20020318/fileserv/FILESERV_200203180324_export_home.tgz
> > 
> > SO I think the backup/backup has something todo with hostname.  The
> > something I need to get this to work with amrestore I think.
> > 
> > Can anyone point me in the right direction?  Does the EOF mean the
> > backup is no good?  Or do I need to use amrestore or amrecover to get to
> > the files I need?  If I do, what would be the most logical syntax to get
> > to those files?
> > 
> > Thank you very much just for reading this far.  :)
> > 
> > Jimmy
> > 
> > 
> > 
> > 
> > -- 
> > Jimmy <jimmy AT v2k DOT ca>


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