Table of Contents
Installation and configuration (server)
Installation and configuration of Amanda on CentOS 5.x.
Download and install
Find appropriate versions of Amanda for your OS at the Download Amanda page.
Download
wget http://www.zmanda.com/downloads/community/Amanda/3.3.0/Redhat_Enterprise_5.0/amanda-backup_server-3.3.0-1.rhel5.x86_64.rpm
Install
sudo rpm -i amanda-backup_server-3.3.0-1.rhel5.x86_64.rpm
This will install Amanda and create a system user for the Amanda program to run as. The installation should output something like this:
Oct 18 2011 12:07:22: Preparing to install: Amanda Community Edition - version 3.3.0 Oct 18 2011 12:07:22: Checking for 'amandabackup' user... Oct 18 2011 12:07:22: Oct 18 2011 12:07:22: The 'amandabackup; user account has been successfully created. Oct 18 2011 12:07:22: Furthermore, the account has been automatically locked for you Oct 18 2011 12:07:22: for security purposes. Once a password for the 'amandabackup' Oct 18 2011 12:07:22: account has been set, the user can be unlocked by issuing Oct 18 2011 12:07:22: the following command as root.: Oct 18 2011 12:07:22: Oct 18 2011 12:07:22: # passwd -u amandabackup Oct 18 2011 12:07:22: Oct 18 2011 12:07:22: If this is not a new installation of Amanda and you have Oct 18 2011 12:07:22: pre-existing Amanda configurations in /etc/amanda Oct 18 2011 12:07:22: you should ensure that 'dumpuser' is set to 'amandabackup' Oct 18 2011 12:07:22: in those configurations. Additionally, you should ensure Oct 18 2011 12:07:22: that /var/lib/amanda/.amandahosts on your client systems Oct 18 2011 12:07:22: is properly configured to allow connections for the user Oct 18 2011 12:07:22: 'amandabackup'. Oct 18 2011 12:07:22: Oct 18 2011 12:07:22: Oct 18 2011 12:07:22: === Amanda backup server installation started. ===
Configure
Detect the tape type
We need to have Amanda detect our tape drive/library, but first make sure a tape is loaded in the drive, or else amtaptype
will fail.
sudo mtx status sudo mtx load 1
Now test the tape. It will take like 5 hours to test the speed, size, etc of the tape:
sudo amtapetype -f /dev/nst0
After a while it will output something like this:
define tapetype unknown-tapetype { comment "Created by amtapetype; compression enabled" length 823948512 kbytes filemark 0 kbytes speed 115076 kps blocksize 32 kbytes } # for this drive and kernel, LEOM is supported; add # device-property "LEOM" "TRUE" # for this device.
Save it somewhere, we'll need to paste it into our config later.
Create a config
Create a config named "daily" from the example tape-changer
config template:
sudo su - amandabackup amserverconfig daily --template tape-changer --tapedev /dev/nst0 --mailto a.orth@cgiar.org
Edit the resulting /etc/amanda/daily/amanda.conf:
- add the "tapetype" block from above
- change "changerdev" to
/dev/sg6
instead of sg1 (usedmesg
and /proc/scsi/scsi to figure out where the changer device is)
Test
Once your configuration is completed, run through a complete backup scenario to test if your settings are correct.
sudo su - amandabackup amcheck daily
Other than errors about tape labels, the command should work fine.
Setup a disklist
Set up a "disklist" for the new config in /etc/amanda/daily/disklist. For now, just do something like so we can test quickly:
localhost /etc root-tar
Use /etc/amanda/template.d/dumptypes and the disklist
manpage as a reference. I tested the "root-tar" backup type instead of the "comp-root-tar" as we’re using hardware compression, so we don’t need software compression!
Label one tape
To test our backup we’ll need to create a tape for Amanda to backup to. Load a tape in the drive and then label it according to the "labelstr" in your config.
mtx load 1 amlabel daily daily-01 slot 1 -f
Run a test backup
Backups are run with the amdump
command (as the "amandabackup" user).
sudo su - amandabackup amdump daily
Test recovery
Make sure you’re the root user! Create a temporary place for us to test recovery of the last dump.
sudo su - mkdir /tmp/restore cd /tmp/restore amrecover localhost amrecover> sethost localhost amrecover> setdisk /etc amrecover> ls amrecover> add slurm amrecover> extract
amrecover
will tell you which tape you need to load in order for it to extract the data. In another terminal use amcheck
and mtx load
to make sure the correct tape is in the drive. amrecover
will restore using the tape defined in /etc/amanda/amanda-client.conf (see the comments in there for how to define it), or you can manually set the tape device in amrecover
using setdevice /dev/nst0
.
amrecover> exit
The restore might take a few minutes because the drive has to spool to the location of the file on the tape. Be patient! The contents of the restore will be found in whichever directory you started the restore from, ie /tmp/restore above.
Delete the temp tape
As the "amandabackup" user delete the tape you used for testing:
sudo su - amandabackup amrmtape daily daily-01
Label more tapes
4 tapes should cover all our data, depending on how well the hardware compression works on the tape drive. Here I’ll label 4 (because we have 4 * 1.6 TB of max disk space on HPC)…
sudo su - mtx unload for tapenum in {1..4}; do mtx load $tapenum; amlabel daily daily-0$tapenum slot $tapenum -f; mtx unload $tapenum; done