Disk Backup With Amanda On Debian Lenny
Disk Backup With Amanda On Debian Lenny1. IntroductionAmanda is an open source client/server
solution to back up filesystems. Backups are triggered by the backup server, backup definitions are located on the servers but exclusion lists are located on the client. Amanda is not yet to the level of backup solutions like IBM TSM/TDP or Legato Networker but it is the best open source solution I found so far. 2. Landscapebckserver.mydomain.com (Debian lenny): The backup server that hosts amanda server. bckclient.mydomain.com (Debian lenny): The backup client is a web server with a MySQL version 5.0 database (no replication). The mysql backup is done with zrm version 2.2. I did not create a howto for zrm since the product is fairly easy to use and the zmanda Quick setup guide and user manual are really easy to follow. My biggest regret with zrm: it does not backup to amanda tapes. An ISCSI SAN as a library. backup to virtual tapes (disks)
3. AMANDA3.1 Backup Server3.1.1 InstallationAs user root install the amanda-server package and ... the amanda-client package or you will not be able to do restores from the bckclient. # apt-get update # apt-get install amanda-server amanda-client xinetd gawk gnuplot readline-common openssh-server Accept the additional packages required when prompted.
3.1.2 (If Applicable) Comment Amanda Entries In Inetd Configuration FileThe packages configure both inetd and xinetd. In this howto we only use xinetd. Edit /etc/inetd.conf and comment amanda related lines: #:OTHER: Other services
3.1.3 Modify Amanda Daemons To Use auth bsdtcpFor details check the wiki. Edit amanda, amidxtape and amandaidx files in /etc/xinetd.d/ to match the following: # cat /etc/xinetd.d/amanda| grep -v "^#" service amanda # cat /etc/xinetd.d/amidxtape | grep -v "^#" service amidxtape # cat /etc/xinetd.d/amandaidx | grep -v "^#" service amandaidx Enable the changes: # /etc/init.d/xinetd restart
3.1.4 Backup ConfigurationWe will define daily backups and the configuration will be called DailySet1. The backup user configured by default at the installation is: user name: backup user group: backup home dir: /var/backups # su backup -c "mkdir /etc/amanda/DailySet1" We create a minimum configuration file amanda.conf for DailySet1: vi /etc/amanda/DailySet1/amanda.conf org "DailySet1" # your organization name for reports Quick explanation: - we plan to use 9 tapes of 5 GigaBytes. We recycle tapes after 9 backups. - we plan to back up everything on the bckclient with some exceptions (ref exclude list section 3.2.6). Check the amanda.conf man page for details on syntax. Create the database repository for DailySet1 as specified in amanda.conf. # su backup -c "mkdir /etc/amanda/DailySet1/logs" # su backup -c "mkdir /etc/amanda/DailySet1/index" # touch /etc/amanda/DailySet1/tapelist # su backup -c "mkdir /etc/amanda/DailySet1/curinfo"
3.1.5 (Optional) Configure Holding DisksThe holding disk is used as a cache to store backup data from all Amanda clients (ref). If you do not intend to use holding disks, review the amanda.conf file. # comment holding disk section if needed
#holdingdisk hd1 {
# directory "/dumps/"
#}
and skip this section. If you plan to use holding disks: # su backup -c "mkdir /dumps" # chmod 750 /dumps I use here a local disk. The details are not covered by this document. # cat /etc/fstab | grep LABEL LABEL=holdingdisk /dumps ext3 defaults 0 LABEL=backup /space xfs _netdev 0 0
3.1.6 Configure Virtual Tapes# mkdir -p /space/ I use my ISCSI SAN disks here. Check this ISCSI howto for details. # mkdir -p /space/vtapes/DailySet1/slots # chown backup:backup -R /space/ # chmod 750 /space/vtapes # su - backup $ cd /space/vtapes/DailySet1/slots Create the tapes: $ for ((i=1; $i<=9; i++)); do mkdir slot$i;done Initialize tape changer: $ ln -s slot1 data Test the virtual tapes: $ ammt -f file:/space/vtapes/DailySet1/slots status file:/space/vtapes/DailySet1/slots status: ONLINE Label the tapes: $ for ((i=1; $i<=9;i++)); do amlabel DailySet1 DailySet1-0$i slot $i; done Note: If you plan to use more than nine tapes (say 25 for example), do run a second amlabel command: $ for ((i=10; $i<=25;i++)); do amlabel DailySet1 DailySet1-$i slot $i; done Reset the virtual tape changer back to the first slot. $ amtape DailySet1 reset amtape: changer is reset, slot 1 is loaded. $ ls -l data lrwxrwxrwx 1 backup backup 35 jun 7 02:27 data -> /space/vtapes/DailySet1/slots/slot1
3.1.7 Backup Definition: DisklistIn this section you specify for each backup client, what disks you intend to back up. On the backup client: As user root issue mount on the backup client to list mounted disks: # mount /dev/mapper/debian-root on / type xfs On the backup server: $ vi /etc/amanda/DailySet1/disklist bckclient.mydomain.com /var/www/www.mysite.com/ daily bckclient.mydomain.com / daily bckclient.mydomain.com /boot/ daily syntax: client.fqdn path dumptype (ref amanda.conf) Note: Since we use fully qualified domain names, your name resolution (/etc/hosts or DNS and reverse DNS) must be correctly set up and tested. If you are unsure use IP addresses.
3.1.8 Authorization: amandahostThis file is used to authorize client or server connections: $ vi /etc/amandahosts bckserver.mydomain.com root amindexd amidxtaped The line: "bckclient.mydomain.com root amindexd amidxtaped" allows user root from bckclient to perform restores. The line "bckserver.mydomain.com backup amdump" allows user backup from bckserver to run backups on bckserver. Details on file syntax and authentification here. Note: Since we use fully qualified domain names, your name resolution (/etc/hosts or DNS and reverse DNS) must be correctly set up and tested. If you are unsure use IP addresses. # ln -s /var/backups/.amandahosts /etc/amandahosts # chmod 400 etc/amandahosts # ls -l /etc/amandahosts -r-------- 1 backup backup 157 mai 27 02:12 /etc/amandahosts # ls -l /var/backups/.amandahosts lrwxrwxrwx 1 root root 16 mai 17 00:41 /var/backups/.amandahosts -> /etc/amandahosts
|

![Creative Commons Attribution-NonCommercial-ShareAlike 2.0 License [Creative Commons Attribution-NonCommercial-ShareAlike 2.0 License]](http://creativecommons.org/images/public/somerights20.gif)


Recent comments
1 day 20 hours ago
2 days 5 hours ago
2 days 7 hours ago
2 days 9 hours ago
2 days 10 hours ago
2 days 12 hours ago
2 days 13 hours ago
2 days 14 hours ago
3 days 6 hours ago
3 days 7 hours ago