Category Archives: Amanda Backup

Openfiler – Installing Amanda Backup Client

Openfiler – Installing Amanda Backup Client

Introduction

This article explains the steps to install the Amanda backup client on to an Openfiler 2.3 server.

The infrastructure used for this article was an Openfiler 2.3 64-bit Virtual Machine running on a Fedora Core 8 64-bit host running VMware Server 1.0.8

The version of Amanda used for this test was version 2.6.1.p1 downloaded from http://sourceforge.net/projects/amanda/files

Pre-requisites

In order to install Amanda on to an Openfiler server the following pre-requisites must be met :-

  • An Openfiler server built using the standard installation
  • The latest Amanda source tarball downloaded to the Openfiler server
  • The GCC compiler

Installing the GCC compiler

The first step to install Amanda on an Openfiler server is to install GCC and its dependencies as Openfiler does not come with it pre-installed.  To install GCC and its dependencies follow the steps below :-

  1. Logon to the console of the Openfiler server as root
  2. At the command prompt execute the commands below :-conary update gcc
    conary update gcc:runtime
    conary update libtool
    conary update glib
    conary update glib:devel
    conary update glibc
    conary update glibc:devel
    conary update automake
    conary update autoconf
    conary update pkgconfig

Create the amandabackup user

The Amanda software runs using an account on system which needs creating before the software is compiled and installed. To create the Amanda user perform the following steps :-

  1. Logon to the console of the Openfiler server as root
  2. At the command prompt execute the commands below :-mkdir /var/lib/amanda
    useradd -d /var/lib/amanda -s /bin/bash -G disk amandabackup
    chown amandabackup:disk /var/lib/amanda
    chmod 700 /var/lib/amanda
    passwd -u -f amandabackup
  3. At the command prompt execute the commands below :-mkdir /etc/amanda
    chown amandabackup:disk /etc/amanda
    chmod 700 /etc/amanda

Compiling and installing Amanda

Once the GCC Compiler has been installed the next step is to compile and install the Amanda software.  To install the Amanda software perform the following steps :-

  1. Unpack the source tarball in to the /tmp foldertar -zvxf amanda-2.6.1.p1.tar.gz
  2. Change directory in to the unpacked folder in tmpcd /tmp/amanda-2.6.1.p1
  3. To compile and install the software execute the commands below :-./configure –with-user=amandabackup –with-group=disk –with-gnutar-listdir=/var/lib/amanda/gnutar-lists
    make
    make install

Create the xinetd amanda config file

Amanda uses the xinetd service to run its service and in order to work a configuration file needs to be created.  To create the xinetd Amanda service file perform the following steps :-

  1. At the command prompt execute the following command :-vi /etc/xinetd.d/amandaclient
  2. In the file insert the following lines :-service amanda
    {
    disable         = no
    flags             = IPv6
    socket_type   = stream
    protocol         = tcp
    wait               = no
    user              = amandabackup
    group            = disk
    groups          = yes
    server           = /usr/local/libexec/amanda/amandad
    server_args    = -auth=bsdtcp amdump
    }
  3. Save and exit the file
  4. Restart the xinetd service by executing the command below :-service xinetd restart
  5. At the command prompt execute the command below and confirm that the amanda service is shown :-netstat -l | grep amanda

Test server to client connectivity

Once the client is installed logon to the Amanda backup server and add the Openfiler to the disklist file in the required Backup Set.

As the Amanda user execute amcheck {Backup Set Name} and confirm that no issues were found with the Openfiler server.

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