Amanda-Users

Re: Removing / replacing tape in cycle

2005-01-10 16:47:30
Subject: Re: Removing / replacing tape in cycle
From: Jon LaBadie <jon AT jgcomp DOT com>
To: amanda-users AT amanda DOT org
Date: Mon, 10 Jan 2005 16:40:02 -0500
On Mon, Jan 10, 2005 at 07:01:34AM +0100, S.Krumme AT stadt-duisburg DOT de 
wrote:
> Hi,
> 
> after trying this and this morning and getting even more confused, I just 
> found out that the tape was faulty.
> 
> I inserted an new one, labeled it tape21 (my tapecycle is from tape1 to 
> tape20), ran amflush and everything is working fine. But know the next 
> question.
> How do I get the faulty one replaced by the new one ? 
> I can´t use a scratch file from the old one, as the header is not readable 
> anymore. The tape gone bad was tape11.
> 

I'm guessing that you believe the data on tape11 to still be good but
the tape-label is messed up.  You could remove each of the files to
hard disk, create a new tape11 with amlabel -f, and copy each of the
hard disk copies of the tape files back to tape.  A small variation
is to copy the tape label from tape21 to disk, edit the "2" to a "1"
and use that as the first file to copy to a blank tape.  That could
eliminate the amlabel step.

Totally untested (need a posix shell like bash or ksh or zsh):

   Dir=/tmp/tape11
   mkdir $Dir           # start with empty dir
   cd $Dir

   Tape="<your no rewind tape dev>
   DDcmd="dd bs=32k if=$Tape"
   MTcmd="mt -f $Tape"

       # load tape21
   $MTcmd rewind
   $MTcmd status        # just like to check
   $DDcmd of=file001    # should be 32k
       
       # edit file01 to change "21" to "11"
       #  I forget if a date should be changed too

       # rewind and unload tape21

       # load the damaged tape11
    $MTcmd rewind
    $MTcmd fsf 1
    $MTcmd status

    typeset -Z3 n=2

    while $DDcmd of=file$n
    do
        let n=n+1
    done

        # each of your files "fileXXX" should be a
        # multiple of 32k  The last one should be
        # exactly 32k and should contain a tape end label

        # rewind and unload the damaged tape11
        # load a blank replacement tape
   
   for f in file*
   do
        dd bs=32k if=$f of=$Tape
   done
-- 
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)

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