Tag: Amanda Backup Using Virtual Tape on Ubuntu
Amanda Backup Using Virtual Tape on Ubuntu
by admin on May.28, 2010, under Amanda, Backup, Ubuntu, Ubuntu 9.10, ubuntu 10.04
Amanda:
AMANDA, the Advanced Maryland Automatic Network Disk Archiver, is a backup system that allows the administrator to set up a single master backup server to back up multiple hosts over network to tape drives/changers or disks or optical media. Amanda uses native dump and/or GNU tar facilities and can back up a large number of workstations running multiple versions of Unix.
This will guide you through setting up virtual tapes (utilize hard disk space for backups)
Install and Modify the xinetd
If you haven’t already installed xinetd, install it
Create an amanda xinetd entry
Code:
sudo vim /etc/xinetd.d/amanda
Give it the following contents
Code:
# default: on
# description: The amanda service
service amanda
{
only_from = ubunutlinux.co.in
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = backup
group = backup
groups = yes
server = /usr/lib/amanda/amandad
server_args = -auth=bsd amdump amindexd amidxtaped
}
service amandaidx
{
socket_type = stream
protocol = tcp
wait = no
group = backup
groups = yes
server = /usr/lib/amanda/amindexd
disable = no
}
service amidxtape
{
socket_type = stream
protocol = tcp
wait = no
user = backup
group = backup
groups = yes
server = /usr/lib/amanda/amidxtaped
disable = no
}
Install the AMANDA Server
Install AMANDA and dependencies
sudo apt-get install amanda-server
Restart xinetd
sudo /etc/init.d/xinetd restart
Become “backup” user
su backup
Create copies of the configuration files, just in case
cp -R /etc/amanda/DailySet1 /etc/amanda/DailySet1.bak
Edit amanda.conf
Let’s get in and edit the amanda.conf
Code:
vim /etc/amanda/DailySet?1/amanda.conf
Make the following changes in the file
Code:
org “”
mailto “backupadmin@ubuntulinux.co.in ”
tpchanger “chg-disk”
changerfile “/etc/amanda/daily/changer”
tapedev “file:/amandabackup/DailySet1/slots”
tapetype HARDDISK
#tapetype HP-DAT <— comment this out
#labelstr “^HISS[0-9][0-9]*$” <— comment this out
amrecover_do_fsf yes
amrecover_check_label yes
amrecover_changer “changer”
define tapetype HARDDISK {
length mbytes
}
The format for the disklist file is :
Dumptypes are deinfed in /etc/amanda/amanda.conf, but we’ll use the GNUTAR dumptype “comp-user-tar” for this example
Let’s get in and edit the disklist
Code:
vim /etc/amanda/DailySet1/disklist
Add a line like so
Code:
ubuntulinux.co.in /Project comp-user-tar
ubuntlinux.co.in /clientbackup comp-user-tar
What this line is telling AMANDA is that when it attempts to do a dump that it should connect to ubuntlinux.co.in, backup the directory /project and /clientbackup and user the options that are defined in amanda.conf for the “comp-user-tar” dumptype.
Create Virtual Tapes
Choose a location for your tapes to reside
Create the tapelist file that is necessary for indexing tapes available
Code:
touch /etc/amanda/DailySet1/tapelist
Create the location and set permissions for the virtual tapes
Code:
mkdir -p -m 770 /amandabackup/DailySet1/slots
chown -R backup:backup /amdndahosts
CD to the new directory
cd /amandabackup/DailySet1/slots
Create the necessary directories for the tapes
Code:
for (i=1; $i<=25; i++)?; do mkdir slot$i; done
Create symlink for the data directory to point to the first tape
Code:
ln -s slot1 data
Test the vtapes to be sure that we get an ONLINE message
Code:
ammt -f file:/amandabackup/DailySet?1/slots status
Label the tapes
for (i=1; $i<=9; i++)?; do amlabel DailySet1 DailySet?1-0$i slot $i; done
for (i=10; $i<=25; i++)?; do amlabel DailySet1 DailySet?1-$i slot $i; done
Output should look like (for each slot)
labeling tape in slot 1 (file:/amandabackup/DailySet?1/slots)
rewinding, reading label, not an amanda tape
rewinding, writing label DailySet?1-01, checking label, done.
Reset the changer back to slot 1
amtape DailySet1 reset
Output should look like
amtape: changer is reset, slot 1 is loaded.
Edit .amandahosts
On Ubuntu the .amandahosts file is located as /etc/amandahosts
Open the file
vim /etc/amandahosts
The file looks like
localhost root amindexd amidxtaped
ubuntlinux.co.in backup
ubuntlinux.co.in backup amindexd amidxtaped
ubuntlinux.co.in root amindexd amidxtaped
Page 2 (amanda client and backup and restore procedure