Amanda-Users

Re: Problems manually restoring from tape

2004-02-29 15:59:09
Subject: Re: Problems manually restoring from tape
From: Paul Bijnens <paul.bijnens AT xplanation DOT com>
To: Chris Cameron <chris AT upnix DOT com>
Date: Sun, 29 Feb 2004 21:52:23 +0100
Chris Cameron wrote:
Hello all,

Just started playing with Amanda this weekend, and things have gone very
well. Being concerned about my ability to restore from tape should I not
have amrestore (or any of the files needed for it to run), I've been
playing around to make sure that I'd be able to restore in a crunch.


In short, my problem is I can't seem to find certain spots in a tape
used by Amanda.

According to my Amanda mail report, 13 file systems were dumped at a
level of 0. When I try to restore one of the file systems that are
further down the tape, I see:

</opt/amanda/sbin> $ ./amrestore /dev/rmt/1n prod2 '/md/dsk/d5'
amrestore:   0: skipping start of tape: date 20040228 label W1Fri
amrestore:   1: skipping devl2._dev_md_dsk_d5.20040228.0
amrestore:   2: skipping prod2._dev_md_dsk_d1.20040228.0
amrestore:   3: skipping gate2._dev_md_dsk_d1.20040228.0
amrestore:   4: skipping gate2._dev_md_dsk_d3.20040228.0
amrestore:   5: skipping prod2._dev_md_dsk_d3.20040228.0
amrestore:   6: skipping gate2._dev_md_dsk_d2.20040228.0
amrestore:   7: skipping gate2._dev_md_dsk_d4.20040228.0
amrestore:   8: skipping devl2._dev_md_dsk_d0.20040228.0
amrestore:   9: skipping prod2._dev_md_dsk_d4.20040228.0
amrestore:  10: restoring prod2._dev_md_dsk_d5.20040228.0



Which is good. However, after rewinding the tape, if I try to manually
restore that filesystem (without amrestore), I see:

</opt/amanda/sbin> $ mt -f /dev/rmt/1 rewind
</opt/amanda/sbin> $ dd if=/dev/rmt/1n bs=32k skip=10 |

Wrong, that should be:
        mt -f /dev/rmt/1 rewind
        mt -f /dev/rmt/1n fsf 10
        dd if=/dev/rmt/1n bs=32k skip = 1 | ufsrestore -if -

/usr/sbin/ufsrestore -if -
Verify volume and initialize maps
dd: cannot skip past end-of-file
Volume is not in dump format
</opt/amanda/sbin> $



I've also tried the script listed in the documentation, and it too
doesn't make it very far:

# TAPEDEV=/dev/rmt/1n
# while mt -f $TAPEDEV fsf 1 ; do

dd if=$TAPEDEV bs=32k count=1 | head -1
sleep 1
done

...
Going off amrestores output, it seems like it's skipping every other
dump, and I'm not sure why it'd be doing that or how to stop it.

You didn't specify what OS, but somehow you have the bsd/att behaviour
of tapes reversed (I would expect a "b" in the device name in that case,
if it is Solaris): in bsd-mode, when you read only one record from
a file, the tape skips to the next file, the mt command skips
again a file.  In non-bsd mode, the dd reads the first record, and
the tapedrive keeps positioned as is. A fsf is needed to skip to the
next file.
Solution: drop the "mt fsf" in the script, or find a way to specify
non-bsd behavior for your tape driver.


--
Paul Bijnens, Xplanation                            Tel  +32 16 397.511
Technologielaan 21 bus 2, B-3001 Leuven, BELGIUM    Fax  +32 16 397.512
http://www.xplanation.com/          email:  Paul.Bijnens AT xplanation DOT com
***********************************************************************
* I think I've got the hang of it now:  exit, ^D, ^C, ^\, ^Z, ^Q, F6, *
* quit,  ZZ, :q, :q!,  M-Z, ^X^C,  logoff, logout, close, bye,  /bye, *
* stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt,  abort,  hangup, *
* PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e,  kill -1 $$,  shutdown, *
* kill -9 1,  Alt-F4,  Ctrl-Alt-Del,  AltGr-NumLock,  Stop-A,  ...    *
* ...  "Are you sure?"  ...   YES   ...   Phew ...   I'm out          *
***********************************************************************

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