Amanda-Users

Re: Help restoring

2005-08-30 13:12:05
Subject: Re: Help restoring
From: Tony van der Hoff <tony AT vanderhoff DOT org>
To: amanda-users AT amanda DOT org
Date: Tue, 30 Aug 2005 17:59:26 +0100
Jon LaBadie <jon AT jgcomp DOT com> wrote in message
<20050826135923.GA25586 AT butch.jgcomp DOT com>

> On Thu, Aug 25, 2005 at 07:43:53PM +0100, Tony van der Hoff wrote:
> > I'm trying to recover my /etc directory from tape, so in accordance with
> > docs/RESTORE, I'm doing this:
> > 
> > [root@tony-lx etc]# mt fsf 1 && dd if=/dev/tape bs=32k count=1
> > AMANDA: FILE 20050821 tony-lx /etc lev 0 comp .gz program /bin/gtar
> > To restore, position tape at start of file and run:
> >    dd if=<tape> bs=32k skip=1 | /bin/gzip -dc | bin/gtar -f... -
> > 
> > 
> > 1+0 records in
> > 1+0 records out
> > [root@tony-lx etc]# dd if=/dev/tape bs=32k skip=1 | /bin/gzip -dc |
> > /bin/gtar -xpvf -
> > 
> > gzip: stdin: not in gzip format
> > 2+0 records in
> > 1+0 records out
> > 
> > And, of course nothing in my restore/etc dir. I hope it's just my
> > incompetence :( 
> > 
> 
> 
> Those two command sequences can not be run one after the other.
> Each assumes the tape is as the same starting position.  After
> positioning the tape to the beginning of a tape file, the first
> command looks at the first block of the tape file.  The second
> command, if started from the same beginning of a tape file,
> skips over the first block (the one read by the first command).
> But if the tape is not at the beginning of the file you either
> don't need to skip anything, or you have to rewind and reposition
> to the beginning of the tape file.
> 
> BTW, I think the device you are using "/dev/tape" is the rewind
> on close device.  Thus after the first dd ... count=1 command
> the tape probably rewinds to the beginning of the tape.
> /dev/ntape is likely the "leave the tape where it is" device.
> 

My sincere thanks to everyone who took the time to reply. As suggested, it
was the 'skip=1' instruction that caused the trouble. Omitting this in the
dd solved it. Stangely, I had already tried a "mt bsf 1" with the aim of
positioning the tape correctly, but that failed to improve matters.
Possibly, I was by then so confused that I messed it up.

As to the other suggestions, my /dev/tape ls symlinked to /dev/nst0, so is
not rewinding. I'm running Mandrake Linux 10.2 here. I created a seperate
/restore/etc directory, in which to restore /etc.

I think my initial confusion arose out of the suggestion from Amanda:
> > To restore, position tape at start of file and run:
> >    dd if=<tape> bs=32k skip=1 | /bin/gzip -dc | bin/gtar -f... -
In fact,
        To restore, run: 
        dd if=<tape> bs=32k | /bin/gzip -dc | bin/gtar -f... -
would maybe have been more helpful and less verbose at this point. 

I guess I should have figured out which 'start of file' to position to, but
failed :-(

Anyway, thanks again.

-- 
Tony van der Hoff        | mailto:tony AT vanderhoff DOT org
Buckinghamshire, England 

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