Amanda – Creating A Centralised Backup Server

Amanda – Creating A Centralised Backup Server

 

Introduction

Amanda (The Advanced Maryland Automatic Network Disk Archiver) is a free backup solution which provides a centralised network backup server that can be used to back up multiple clients to disk or tape and in this article the steps to build a server on CentOS 5.5 are explained.

Pre-Requisites

  • A base installation of CentOS 5.5
  • Xinetd installed and configured on the server
  • A copy of the Amanda Version 3.2.1 Source Tarball
  • Gd installed on the server
  • Gnuplot installed on the server

Create The Amanda User

Prior to compiling and installing the Amanda server the amanda user needs to be created on the system.  To create the user and configure its home folder perform the following steps :-

  • In the command prompt execute the following commands

useradd -d /var/lib/amanda -s /bin/bash -G disk amanda 

chown amanda:disk /var/lib/amanda 

chmod 700 /var/lib/amanda

Compiling And Installing Amanda

The compilation of Amanda on the server required several options to be added in order to correctly build it for the environment and below is a copy of the command line used with explanations of the options afterwards :-

./configure –with-user=amanda –with-group=disk –with-config=config-1 –with-bsdtcp-security

–with-user=amanda – Specifies the username that Amanda will use

–with-group=disk – Specifies the group that Amanda will use

–with-config=config-1 – Specifies the Configuration Name to be used (This will be added to the example amanda.conf file)

–with-bsdtcp-security – Specifies that the server should use bsdtcp security to talk to clients (This is used as the Windows Client uses bsdtcp security only)

To compile and install Admanda on the server perform the following steps :-

  • In the command prompt execute the commands below

./configure (With the relevant options for your environment)

make 

make install

Configure The Amanda Xinetd Service

Once the software has finished installing the next step is to configure the Amanda xinetd Service.  To configure the Amanda xinetd service perform the following steps :-

  • Copy the example file /usr/local/share/amanda/examples/xinetd.amandaserver to /etc/xinetd.d/amandaserver
  • Edit the file and change the username from amandabackup to amanda
  • Save and exit the file
  • Configure the xinetd service to start at boot time execute chkconfig xinetd on
  • Start the xinetd service by executing service xinetd start

Creating The Amanda.Conf File

The example amanda.conf file is installed as part of the compilation routine in /usr/local/share/amanda/example which provides a good starting point.  The build for this article uses the example configuration file and then builds upon it so only provides the lines which have been added or modified.  To configure the Amanda.Conf file perform the following steps :-

  • In the command prompt execute mkdir /user/local/etc/amanda/config-1 to create the folder, where
  • Next copy the example file /usr/local/share/amanda/examples/amanda.conf to /usr/local/etc/amanda/config-1/amanda.conf
  • Edit the copied amanda.conf file and check / change the lines listed below to the values given :-

org “config-1”
dumpuser “amanda”
netusage 600Kbps
dumpcycle 1 week
runspercycle 5
tapecycle 15
tpchanger “chg-disk”
changerfile “/usr/local/etc/amanda/config-1/changer”
tapedev “file:/backups/config-1-backups/slots”
labelstr “^Config-1-Backups-[0-9][0-9]*$”
amrecover_changer “changer”
infofile “/usr/local/etc/amanda/config-1/curinfo”
logdir   “/usr/local/etc/amanda/config-1”
indexdir “/usr/local/etc/amanda/config-1/index”
tapetype HARDDISK

  • Edit the section holdingdisk hd1 and change to the following :-

holdingdisk hd1 {
  comment “main holding disk”
  directory “/backups/wonderland-backups/dumps”
  use -100 Mb
  chunksize 1Gb
  }

  • Create the section below to configure a Virtual Tape Library on the servers disk :-

tapetype HARDDISK {
  comment “Backup to Virtual Tape”
  length 1024 mbyts
  }

  • Save and Exit the file

Add Clients To The Disklist

The disklist file is where the client machine names, folders to be backed up, and dump method are held and needs configuring before Amanda will work.  To configure ther disklist file perform the following steps :-

  • Edit the file /usr/local/etc/config-1/disklist and add in the line below to perform a backup of the /etc folder using the comp-user-tar dumptype and a machine called backupclient.domain.com :-

backupclient.domain.com /etc comp-user-tar

  • Save and exit the file

Create And Label The Virtual Tapes

Amanda is capable of using Virtual Tapes which effectively back up the data to a file on a hard disk.  To create and label a set of 15 Virtual Tapes perform the following steps :-

  • To create and label the tapes execute the following commands in the command prompt :-

touch /usr/local/etc/amanda/config1/tapelist
mkdir -p -m 770 /backups/config-1-backups/slots

chown -R amanda:disk /backups
chown -R amanda:disk /usr/local/etc/amanda

su – amanda
cd /backups/config-1-backups/slots

for ((i=1; $i<=15; i++)); do mkdir slot$i; done
ln -s slot1 data

for ((i=1; $i<=15; i++)); do /usr/local/sbin/amlabel config-1 Config-1-Backups-$i slot $i; done

/usr/local/sbin/amtape config-1 reset

Create Remaining Folders And Set Permissions

The last part of setting up Amanda to run correctly on the server is to create the folders below which it uses for storing information on the hosts backed up :-

  • To create the remaining folders which are required execute the following commands in the command prompt whilst logged in as the amanda user :-

mkdir /usr/local/etc/amanda/WonderlandBackups/curinfo
mkdir /usr/local/etc/amanda/WonderlandBackups/index
mkdir /var/lib/amanda/gnutar-lists

Acknowledgements

The following sites were used to perform this build and troubleshoot the issues incurred :-

Amanda Centralised Backup Server On CentOS

Installing Amanda Source

Selfcheck Request Failed Troubleshooting

How To Setup Virtual Tapes