Amanda-Users

Re: amrmtape question

2004-02-05 14:33:44
Subject: Re: amrmtape question
From: Christoph Scheeder <christoph.scheeder AT scheeder DOT de>
To: Jean-Louis Martineau <martinea AT iro.umontreal DOT ca>
Date: Thu, 05 Feb 2004 20:30:56 +0100
Hi,
before going any further on this path:

Do you/we realy want to change that behavior of amanda ?
It's been there since more or less ancient times!
(At least since amanda-2.4.0 when i started using amanda)

The current behavior has it's pros, but i can't see real contras at
the moment.

amrmtape has always been used to remove the contents of a tape from amanda's databases, not to make it unusable for amanda.

i can't see a real-life situation where you want to have a tape
with a correct label for a configuration but won't allow amanda to touch it, that can't be handled with "amadmin noreuse".

I would say we should not touch this behavior without a verry good
reason.

Christoph

Jean-Louis Martineau schrieb:
Hi,

Amanda should not use a tape if it's label is not in the tapelist file.

Could you try this patch.

Jean-Louis

On Thu, Feb 05, 2004 at 05:27:36PM +0100, Christoph Scheeder wrote:

Hi,

amrmtape only removes the entrys for the tape from all databases,
but amanda will happily use it if she sees it again as the label
on tape is not touched at all.

The question is what should be achieved:

1.) make amanda forget about the backups on that tape?
-> ok, amrmtape is your friend, it does what you want.

2.) you want amanda to reject the tape when she sees it again?
-> "amadmin <config> <tape-label> noreuse" marks the tape as
  "this tape is not allowed to be overwrite by amanda"

3.) you want to delete the amanda tapelabel and all other data
   from the tape, so amnda doesn't touch it anymore?
-> use dd to overwrite the first block on the tape with 0 or random data.

Christoph

Dave Ewart schrieb:


On Thursday, 05.02.2004 at 10:05 -0500, Kin-Ho Kwan wrote:



Hi,

Is it sufficient enough to just run "amrmtape -n conf TAPE001" so that
Amanda will not use this tape for backup?

I try to run "amrmtape -n conf TAPE001", but Amanda still use that
tape to backup stuff. Is there any other command I need to run to
remove the Amanda label?


Reading TFM, I see:

-n     Generate new tapelist and database files with label
     removed, but  leave them in /tmp and do not update the
     original copies.

I suggest dropping the '-n' ... :-)

Dave.


------------------------------------------------------------------------

diff -u -r --show-c-function --exclude-from=amanda.diff 
amanda-2.4.5b1.orig/server-src/amcheck.c amanda-2.4.5b1.new/server-src/amcheck.c
--- amanda-2.4.5b1.orig/server-src/amcheck.c    2003-11-25 07:21:07.000000000 
-0500
+++ amanda-2.4.5b1.new/server-src/amcheck.c     2004-02-05 11:42:09.000000000 
-0500
@@ -959,7 +959,11 @@ int start_server_check(fd, do_localchk, tapebad = 1;
        } else if(strcmp(label, FAKE_LABEL) != 0) {
            tp = lookup_tapelabel(label);
-           if(tp != NULL && !reusable_tape(tp)) {
+           if(tp == NULL) {
+               fprintf(outf, "ERROR: label %s match labelstr but it not listed in 
the tapelist file.\n", label);
+               tapebad = 1;
+           }
+           else if(tp != NULL && !reusable_tape(tp)) {
                fprintf(outf, "ERROR: cannot overwrite active tape %s\n", 
label);
                tapebad = 1;
            }
diff -u -r --show-c-function --exclude-from=amanda.diff 
amanda-2.4.5b1.orig/server-src/taper.c amanda-2.4.5b1.new/server-src/taper.c
--- amanda-2.4.5b1.orig/server-src/taper.c      2003-11-25 07:21:08.000000000 
-0500
+++ amanda-2.4.5b1.new/server-src/taper.c       2004-02-05 11:42:21.000000000 
-0500
@@ -1791,7 +1791,14 @@ int label_tape()
    /* check against tape list */
    if (strcmp(label, FAKE_LABEL) != 0) {
        tp = lookup_tapelabel(label);
-       if(tp != NULL && !reusable_tape(tp)) {
+       if(tp == NULL) {
+           errstr = newvstralloc(errstr,
+                                 "label ", label,
+               " match labelstr but it not listed in the tapelist file",
+                                 NULL);
+           return 0;
+       }
+       else if(tp != NULL && !reusable_tape(tp)) {
            errstr = newvstralloc(errstr,
                                  "cannot overwrite active tape ", label,
                                  NULL);


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