How to install and configure AMAND backup server and client on LINUX

Hi all, In this article we will learn how to install amanda backup server and cofigure it to start taking backups. It is completely free and based on GPL License. we don't need to pay any license fee to use this software in live/production environment.

Steps to install amanda backup server.

  1. Install centos 5.2 x86_64.
  2. Get rpm from www.amanda.org/download.php for latest stable version of amanda server. E.g amanda-backup_server-2.6.1p2-1.rhel5.x86_64.rpm
  3. install this downloaded rpm using #rpm –ivh command
    e.g #rpm –ivh amanda-backup_server-2.6.1p2-1.rhel5.x86_64.rpm
  4. If there were any missing dependencies then it will ask you to install that first. It will also create required files and directories.
  5. Default configuration directory is /etc/amanda for all configurations.
  6. We have 4 TB separate storage for backups. That storage is mounted on /amanda partition.
  7. I have copied all configuration from /etc/amanda to /amanda and created soft link from /etc/amanda --> /amanda
  8. Configuration file which holds details about what is getting backed up is /amanda/DailySet123/disklist.
  9. Imp configuration about server, tapes etc is in /etc/amanda/DailySet123/amanda.conf.
  10. My amanda.conf file is as below

      org "DailySet123" # your organization name for reports
      mailto "user@domain" # space separated list of operators at your site
      dumpuser "amandabackup" # the user to run dumps under
      inparallel 4 # maximum dumpers that will run in parallel (max 63)
      dumporder "sssS" # specify the priority order of each dumper
      taperalgo first # The algorithm used to choose which dump image to send
      displayunit "m" # Possible values: "k|m|g|t"

      netusage 600000 Kbps # maximum net bandwidth for Amanda, in KB per sec
      dumpcycle 1 week # the number of days in the normal dump cycle
      runspercycle 7 # the number of amdump runs in dumpcycle days
      tapecycle 240 # the number of tapes in rotation
      bumpsize 20 Mb # minimum savings (threshold) to bump level 1 -> 2
      bumppercent 20 # minimum savings (threshold) to bump level 1 -> 2
      bumpdays 1 # minimum days at each level
      bumpmult 4 # threshold = bumpsize * bumpmult^(level-1)
      etimeout 3600 # number of seconds per filesystem for estimates.
      dtimeout 7200 # number of idle seconds before a dump is aborted.
      ctimeout 100 # maximum number of seconds that amcheck waits

      runtapes 40 # number of tapes to be used in a single run of amdump
      tpchanger "chg-disk" # the tape-changer glue script
      tapedev "file:/etc/amanda/DailySet123/vtape/slots" # the no-rewind tape device to be used
      changerfile "/etc/amanda/DailySet123/vtape/chg-disk-status"
      maxdumpsize -1 # Maximum number of bytes the planner will schedule
      tapetype HARD-DISK # what kind of tape it is (see tapetypes below)
      labelstr "^DailySet123-[0-9][0-9]*$" # label constraint regex: all tapes must match
      amrecover_do_fsf yes # amrecover will call amrestore with the
      amrecover_check_label yes # amrecover will call amrestore with the
      amrecover_changer "null:" # amrecover will use the changer if you restore
      holdingdisk hd1 {
      comment "main holding disk"
      directory "/holding" # where the holding disk is
      use -5 Gb # how much space can we use on it
      chunksize 1Gb # size of chunk if you want big dump to be
      }
      autoflush no #
      infofile "/etc/amanda/DailySet123/curinfo" # database DIRECTORY
      logdir "/etc/amanda/DailySet123/logs" # log directory
      indexdir "/etc/amanda/DailySet123/index" # index directory
      define tapetype HARD-DISK {
      comment "Dump onto hard disk"
      length 10240 mbytes # specified in mbytes to get the exact size of 10GB
      }
      define dumptype global {
      comment "Global definitions"
      auth "bsd"
      maxdumps 2
      estimate calcsize
      fallback_splitsize 1g
      holdingdisk yes
      index yes
      tape_splitsize 1G
      }
      define dumptype always-full {
      global
      comment "Full dump of this filesystem always"
      compress none
      priority high
      dumpcycle 0
      }
      define dumptype root-tar {
      global
      program "GNUTAR"
      comment "root partitions dumped with tar"
      compress none
      index
      priority low
      }
      define dumptype user-tar {
      root-tar
      comment "user partitions dumped with tar"
      priority medium
      }
      define dumptype user-tar-span {
      root-tar
      comment "tape-spanning user partitions dumped with tar"
      priority medium
      }
      define dumptype user-tar-span-tcp {
      root-tar
      auth "bsdtcp"
      comment "tape-spanning user partitions dumped with tar"
      priority medium
      }
      define dumptype high-tar {
      root-tar
      comment "partitions dumped with tar"
      priority high
      }
      define dumptype comp-root-tar {
      root-tar
      comment "Root partitions with compression"
      compress client fast
      }
      define dumptype comp-root-tar-span {
      comp-root-tar
      comment "Root partitions with compression"
      }
      define dumptype comp-root-tar-span-tcp {
      comp-root-tar
      auth "bsdtcp"
      comment "Root partitions with compression"
      }
      define dumptype comp-user-tar {
      user-tar
      compress client fast
      }
      define dumptype comp-user-tar-span {
      user-tar-span
      compress client fast
      }
      define dumptype comp-user-tar-span-tcp {
      user-tar-span
      auth "bsdtcp"
      compress client fast
      }
      define dumptype holding-disk {
      global
      comment "The master-host holding disk itself"
      holdingdisk no # do not use the holding disk
      priority medium
      }
      define dumptype comp-user {
      global
      comment "Non-root partitions on reasonably fast machines"
      compress client fast
      priority medium
      }
      define dumptype comp-user-span {
      global
      comment "Tape-spanning non-root partitions on reasonably fast machines"
      compress client fast
      priority medium
      }
      define dumptype nocomp-user {
      comp-user
      comment "Non-root partitions on slow machines"
      compress none
      }
      define dumptype nocomp-user-span {
      comp-user-span
      comment "Tape-spanning non-root partitions on slow machines"
      compress none
      }
      define dumptype comp-root {
      global
      comment "Root partitions with compression"
      compress client fast
      priority low
      }
      define dumptype nocomp-root {
      comp-root
      comment "Root partitions without compression"
      compress none
      }
      define dumptype comp-high {
      global
      comment "very important partitions on fast machines"
      compress client best
      priority high
      }
      define dumptype nocomp-high {
      comp-high
      comment "very important partitions on slow machines"
      compress none
      }
      define dumptype nocomp-test {
      global
      comment "test dump without compression, no /etc/dumpdates recording"
      compress none
      record no
      priority medium
      }
      define dumptype comp-test {
      nocomp-test
      comment "test dump with compression, no /etc/dumpdates recording"
      compress client fast
      }
      define dumptype custom-compress {
      global
      program "GNUTAR"
      comment "test dump with custom client compression"
      compress client custom
      client_custom_compress "/usr/bin/bzip2"
      }
      define dumptype encrypt-fast {
      global
      program "GNUTAR"
      comment "test dump with fast client compression and server symmetric encryption"
      compress client fast
      encrypt server
      server_encrypt "/usr/local/sbin/amcrypt"
      server_decrypt_option "-d"
      }
      define interface local {
      comment "a local disk"
      use 1000 kbps
      }
      define interface le0 {
      comment "10 Mbps ethernet"
      use 400 kbps
      }

  11. As we have created virtual tapes using disk storage, we need to perform following steps before we using those disks.

    1. a. Create empty directories using this command from command prompt
      #for n in `seq 1 200`; do mkdir /amanda/DailySet123/vtape/slots/slot${n}; done
      Note: this will create 200 empty directories. Slot1 to slot200
      b. Then we need to label each of slot with specific label for amanda to use it.
      # for n in `seq 1 200` ; do amlabel DailySet123 DailySet123-${n} slot ${n}; done
      c. Each directory size is limited to 10GB. It is defined in amanda.conf file.

    10. All backup related processes are owned by user “amandabackup”. It is a local system user.
    11. To check / test the configuration manually use following steps.

    a. Login to server as root user.
    b. su - amandabackup
    c. amcheck DailySet123

    This is to check and verify whether your configuration is valid and amanda server is able to connect to other servers to take backups or not. It will display output something like :

      [root@mybackupserver ~]# su - amandabackup
      -sh-3.2$ amcheck DailySet123
      Amanda Tape Server Host Check

      -----------------------------
      Holding disk /holding: 143292 MB disk space available, using 138172 MB
      slot 183:read label `DailySet123-123', date `20100129334512'.
      NOTE: skipping tape-writable test
      Tape DailySet123-123 label ok
      Server check took 5.746 seconds

      Amanda Backup Client Hosts Check
      --------------------------------
      Client check: 40 hosts checked in 1.352 seconds. 0 problems found.

      (brought to you by Amanda 2.6.1p2)
      -sh-3.2$

    My disklist configuration file is as below

      server1 /etc comp-root-tar-span

      server2 /etc comp-root-tar-span-tcp
      server3 /etc comp-root-tar-span
      server3 /usr/local/nagios comp-root-tar-span

      server4 /etc comp-root-tar-span-tcp
      server4 /var comp-user-tar-span-tcp
      server4 /nfs/home comp-user-tar-span-tcp
      server4 /nfs/newrepository user-tar-span-tcp

      server5 /development comp-user-tar-span-tcp
      server5 /shared_development comp-user-tar-span-tcp
      server5 /production1/content comp-user-tar-span-tcp
      server5 /production1/common_files {
      server5 /production1/common_files {
      comp-user-tar-span-tcp
      exclude "./myimages/"
      exclude append "./mylogdir*"
      } 3

Back to top