View Full Version : Erase Virtual Tape - HOW?

July 5th, 2007, 12:09 PM
Hi there,

could anybody please tell me what is the correct way to erase a virtual tape (of a virtual changer) that contains Amanda data? To be more precise...

I backed up some data for testing to the virtual tapes. Now I want to start from the beginning, so...
- erase the tapes contents
- delete any amanda information that refer to the tape contents

So, all in all...just a fresh beginning of backup just as I would run "amdump xyz" the first time.

How can I do this? I wonder if amlabel or amrmtape is the right thing but nothing worked the way I am searching for.


July 5th, 2007, 12:30 PM

There is a number of ways to accomplish what you are trying to do.

The easiest and cleanest way would be to use, amrmtape.
Please find below an example on using it <for my example I am using a backup set named DailySet1>.

amrmtape DailySet1 DailySet1-001

This command would remove the vtape labeled DailySet1-001 for the backup set DailySet1, from the Amanda Index. You could run this command for each of your Vtapes that you have labeled. After which you could delete the contents of the slot directories(in your vtapes folder), and then relabel your tapes, using amlabel with the --force switch.

Once you do this run an amcheck and everything should pass.

Then you can proceed by running amdump DailySet1.

Feel free to post back if you have any other questions or issues.


July 7th, 2007, 10:52 AM
Thank you very much. That was exactly the information I was searching for.

Playing around with Amanda I have one last question. It seems to me that there is a problem with the "amcleanup -k ..." script under Debian using Amanda Version 2.5.1p3. Every time I run the script I get the following:

awk: illegal field $(), name "_"
input record number 1, file
source line number 1

...and no processes were killed.

Any idea?


July 9th, 2007, 02:38 PM
Works for me on a 3.1 debian system, pl check if the awk binary is correct. Here is the extract from my system:
# cat /etc/debian_version
# uname -a
Linux debian-build 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686 GNU/Linux
#awk -W version
mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan

compiled limits:
max NF 32767
sprintf buffer 1020

#sudo -u amandabackup amcleanup -k test
amcleanup: No Amanda processes were found running.
amcleanup: no unprocessed logfile to clean up.
********running amdump for config test******
#ps -eaf |grep test
amandab 3092 1586 0 18:35 pts/0 00:00:00 /bin/sh /usr/local/sbin/amdump test
amandab 3102 3092 0 18:35 pts/0 00:00:00 /usr/local/libexec/planner test
amandab 3103 3092 0 18:35 pts/0 00:00:00 /usr/local/libexec/driver test
amandab 3104 3103 0 18:35 pts/0 00:00:00 taper test
amandab 3105 3103 0 18:35 pts/0 00:00:00 dumper0 test
amandab 3106 3103 0 18:35 pts/0 00:00:00 dumper1 test
amandab 3107 3103 0 18:35 pts/0 00:00:00 dumper2 test
amandab 3108 3104 0 18:35 pts/0 00:00:00 taper test
amandab 3111 3103 0 18:35 pts/0 00:00:00 dumper3 test
root 3116 11372 0 18:35 pts/1 00:00:00 grep test
debian-build:/usr/local/etc/amanda/DailySet1# sudo -u amandabackup amcleanup -k test

July 9th, 2007, 06:16 PM

Here is my result:
root@LS-GL7D6:~# cat /etc/debian_version

root@LS-GL7D6:~# uname -a
Linux LS-GL7D6 #77 Tue Dec 5 22:23:46 CST 2006 armv5tejl GNU/Linux

awk: "awk -W version" did not work for me so I found out that under Debian 4.0 the package "orginal-awk" is used by default. The version you are using ("mawk") works fine.

So this was the problem. - THANKS.

Is this a bug of Amanda, worth reporting? What do you think?