Adding Virtual Tapes to an Amanda Config in a RAIT
The task: say you have 25 virtual tapes already defined in you config and you want to add 35 more for a grand total of 60. Here’s an HowTo.
First modify amanda.conf for the config called (say) vtape
# Comment out tpchanger if it is already define as a rait, eg:
#tpchanger "chg-rait:{chg-disk:/usb1/amanda/vtapes,chg-disk:/usb2/amanda/vtapes}"
# Update the tapecycle
tapecycle 60 tapes
# Comment autolabel to be on the safe side
#autolabel "vtape-%%%"
# Add the chg-disk changer
tpchanger "chg-disk:/usb1/amanda/vtapes"
Create the slots and the labels for the 1st part of the mirror:
~># for i in `seq 26 60`; do su amanda -c "mkdir /usb1/amanda/vtapes/slot$i"; done ~># for i in `seq 26 60`; do su amanda -c "~amanda/sbin/amlabel vtape vtape-$i slot $i"; done Reading label... Found an empty tape. Writing label 'vtape-26'... Checking label... Success! ... Reading label... Found an empty tape. Writing label 'vtape-60'... Checking label... Success!
Next, in amanda.conf modify the tpchanger to point to the second part of the mirror (ie s/vtape-1/vtape-2):
tpchanger "chg-disk:/usb2/amanda/vtapes"
Make the slots, and force (-f) the labeling of the tapes in the 2nd changer with:
~># for i in `seq 26 60`; do su amanda -c "mkdir /usb1/amanda/vtapes/slot$i"; done ~># for i in `seq 26 60`; do su amanda -c "~amanda/sbin/amlabel -f vtape vtape-$i slot $i"; done Reading label... Found an empty tape. Writing label 'vtape-26'... Checking label... Success! ... Reading label... Found an empty tape. Writing label 'vtape-60'... Checking label... Success!
Undo the changes made to amanda.conf.
Change back the tpchanger definition to use the changer chg-rait:
tpchanger "chg-rait:{chg-disk:/usb1/amanda/vtapes,chg-disk:/usb2/amanda/vtapes}"
Amanda is now happy:
~># su amanda -c "~amanda/sbin/amcheck vtape"
Amanda Tape Server Host Check
-----------------------------
Holding disk /export01/holddisk/: 151580 MB disk space available, using 150556
MB
slot {26,26}: volume 'vtape-26'
Will write to volume 'vtape-26' in slot {26,26}.
NOTE: skipping tape-writable test
Server check took 1.086 seconds
Amanda Backup Client Hosts Check
--------------------------------
Client check: 1 host checked in 1.183 seconds. 0 problems found.
(brought to you by Amanda 3.3.4)
