Amanda-Users

Re: Can't quite read tape

2003-05-14 12:07:57
Subject: Re: Can't quite read tape
From: Josh Kuperman <josh AT saratoga.lib.ny DOT us>
To: amanda-users AT amanda DOT org
Date: Wed, 14 May 2003 12:06:10 -0400
Now this almost falls into the I feel like a complete idiot
category. In any case I learned the things that amrestore does that
dd can't do. 

1. It reads the tape headers to position the tape, so that as long as
   the backup file is beyond the starting point it will find
   it. Though it is probably easier to rewind first, this came in
   handy when I noticed a typo. So everyone was right who said as long
   as amanda is installed use amrecover.

2. It uses the same compression/decompression program as the
   backup. With dd I would have to pipe to gzip or zcat or whatever it
   was that I turned on (or didn't turn on ) when I started to
   compress. This would have been fine except either I don't have
   compression on, or I'm not using gzip even though the headers say
   I'm using gzip, or I'm using a different gzip. [ I should really
   figure out why I got this wrong.

And yes when I logged into my back up host and ran:

/usr/local/sbin/amrestore -p /dev/nst0 remote-host /home | tar -xf -
./sites/site1/users/nameless
 

It recovered enough for me to learn that the user had deleted the file
they asked me to recover long before they realized it.



On Wed, May 14, 2003 at 11:10:56AM -0400, Jon LaBadie wrote:
> On Wed, May 14, 2003 at 10:53:34AM -0400, Josh Kuperman wrote:
> > On Wed, May 14, 2003 at 10:23:55AM -0400, Brian Cuttler wrote:
> > > Josh,
> > > 
> > > Let amanda do the work.
> > > 
> > > # amrestore -p /tape/drive amclient-name partition-name | (os)restore -if 
> > > - .
> > > 
> > 
> > There are two problems. I did try this first, since I have been
> > printing out instructions which say to do exactly that without testing
> > them. When I set up the Cobalt server, I downloaded the version of
> > gnutar that was recommended and started using tar instead of
> > dump. restore is the inverse of dump and is not usable with a tar
> > archive.
> 
> You should be able to change Brian's command to '...... | gnutar xf - 
> <files-dir>'
> Might need the gzip -dc in there too.
> 
> The restore part of amrestore does not imply dump/restore.
> 
> > Is there any difference between manually positioning the tape to the
> > file and using dd and using amrecover. That is, given the output of
> > the dump says that file # 4, on host X, contails filesystem /. Then is
> > there a difference between 
> > 
> > >mt -f /dev/nst0 asf 4
> > >dd if=/dev/nst0 bs=32k skip=1 | restore -if -
> > 
> > and 
> > >amrestore -p /dev/nst0 X / | restore -if -
> 
> I think they are equivalent, but in your original post, if you followed
> the sequence you showed, you first read over the header and then skipped
> another 32K block when you extracted the data.  There should have been
> a repositioning command between them.
> 
> -- 
> Jon H. LaBadie                  jon AT jgcomp DOT com
>  JG Computing
>  4455 Province Line Road        (609) 252-0159
>  Princeton, NJ  08540-4322      (609) 683-7220 (fax)

-- 
Josh Kuperman                       
josh AT saratoga.lib.ny DOT us


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