Amanda Backup System Configuration

Amanda (Advanced Maryland Automatic Network Disk Archiver) is a mature, open-source backup system designed for reliable, network-based backup and recovery across heterogeneous environments. With integrated tape and disk support, concurrent multi-client backups, and sophisticated scheduling algorithms, Amanda efficiently manages backup resources while maintaining strict recovery time objectives. This guide covers deploying Amanda infrastructure and configuring comprehensive backup strategies.

Table of Contents

  1. Amanda Architecture and Components
  2. Server Installation
  3. Client Installation and Configuration
  4. Amanda Configuration Files
  5. Disklist and Host Management
  6. Backup Scheduling
  7. Backup Operations
  8. Recovery Procedures
  9. Conclusion

Amanda Architecture and Components

Amanda consists of integrated components:

  • Server: Maintains catalog, coordinates backups, manages storage
  • Tape/Disk Changer: Manages storage media rotation
  • Dumper: Creates backup images on server
  • Taper: Writes to storage media
  • Client Daemon: Runs on systems being backed up
  • Report Generator: Creates backup status reports

Amanda's "holding disk" provides temporary staging area for backups before writing to final storage, enabling parallel backup operations and optimizing tape utilization.

Server Installation

Prerequisites

# System requirements:
# - 4+ vCPU cores
# - 8+ GB RAM
# - High-capacity storage for holding disk (500GB+ recommended)
# - Network connectivity to all backup clients

# Check available resources
nproc
free -h
df -h

# Create Amanda system user
sudo useradd -r amanda || true

Installing Amanda Server on Ubuntu/Debian

# Install Amanda server
sudo apt-get install -y amanda-server amanda-client

# Install optional components
sudo apt-get install -y amanda-backup-client amanda-recover

# Create backup user home directory
sudo usermod -d /var/lib/amanda amanda
sudo mkdir -p /var/lib/amanda
sudo chown amanda:amanda /var/lib/amanda

# Initialize Amanda catalog directory
sudo mkdir -p /etc/amanda
sudo chown amanda:amanda /etc/amanda

# Start Amanda daemon
sudo systemctl enable amanda
sudo systemctl start amanda

# Verify service
sudo systemctl status amanda

Installing Amanda Server on CentOS/RHEL

# Install from EPEL
sudo yum install -y epel-release
sudo yum install -y amanda-server amanda-client

# Create directories
sudo mkdir -p /var/lib/amanda
sudo mkdir -p /etc/amanda
sudo chown amanda:amanda /var/lib/amanda
sudo chown amanda:amanda /etc/amanda

# Start xinetd (Amanda uses it)
sudo systemctl enable xinetd
sudo systemctl start xinetd

Firewall and Network Configuration

# UFW (Ubuntu)
sudo ufw allow 10080/tcp  # Amanda server
sudo ufw allow 10080/udp
sudo ufw allow 10082/tcp  # Backup client
sudo ufw allow 10082/udp

# Firewalld (CentOS/RHEL)
sudo firewall-cmd --permanent --add-port=10080-10082/tcp
sudo firewall-cmd --permanent --add-port=10080-10082/udp
sudo firewall-cmd --reload

# Edit /etc/xinetd.d/amanda if needed
sudo nano /etc/xinetd.d/amanda
# Ensure bind_address = 0.0.0.0
sudo systemctl reload xinetd

Client Installation and Configuration

Installing Amanda Client

# On each backup client:
sudo apt-get install -y amanda-client

# Or on CentOS/RHEL:
sudo yum install -y amanda-client

# Create Amanda user if not exists
sudo useradd -r amanda || true

# Create .amandahosts file
sudo nano /etc/amanda/.amandahosts

# Add server access:
# server.example.com root amanda
# server.example.com backup amanda

# Set permissions
sudo chmod 600 /etc/amanda/.amandahosts
sudo chown amanda:amanda /etc/amanda/.amandahosts

Client xinetd Configuration

# Edit xinetd configuration for amanda
sudo nano /etc/xinetd.d/amanda

# Configure:
cat <<'EOF' | sudo tee /etc/xinetd.d/amanda
service amanda
{
  socket_type = dgram
  protocol = udp
  wait = yes
  user = amanda
  group = disk
  server = /usr/lib/amanda/amandad
  server_args = -auth=bsdtcp amdump amindexd ambackupd
  disable = no
  only_from = 192.168.1.10  # Amanda server IP
}
EOF

# Reload xinetd
sudo systemctl reload xinetd

# Test connectivity from server
sudo -u amanda nc -u 192.168.1.30 10080

Amanda Configuration Files

Main Amanda Configuration

Create /etc/amanda/daily/amanda.conf:

# Create configuration directory
sudo mkdir -p /etc/amanda/daily
sudo chown amanda:amanda /etc/amanda/daily

# Create main configuration
cat <<'EOF' | sudo tee /etc/amanda/daily/amanda.conf
# Amanda configuration for daily backups
org = "My Organization"
mailto = [email protected]
dumpuser = amanda
tpchanger = "chg-disk"
changerdev = "/dev/null"
changerfile = "/var/lib/amanda/daily/changer-status"
tapecycle = 10
autolabel = "daily-%%"
labelstr = "^daily-[0-9][0-9]*$"
tapetype = DLT
define tapetype DLT {
  comment = "HP DLT drive"
  length = 160000 mbytes
  filemark = 1 mbyte
  speed = 20000 kps
}

# Dumper configuration
inparallel = 4
dumptype = default {
  priority = medium
  compress = server
  estimate = calcsize
  holdingdisk = yes
}

# Holding disk configuration
holdingdisk hd1 {
  comment = "Holding disk one"
  directory = /var/lib/amanda/daily
  use = 20 gbytes
}

# Network interface
netusage = 800 mbytes

# Log and index directories
logdir = "/var/log/amanda/daily"
indexdir = "/var/lib/amanda/daily/index"

# Cleanup policies
amrecover_do_fsf = yes
amrecover_check_label = yes
autoflush = yes
starttime = 1830

# Encryption (optional)
# encryption = server
# compress = server

# Amanda network security
bsd_security_options = "ssh"
EOF

sudo chown amanda:amanda /etc/amanda/daily/amanda.conf
sudo chmod 640 /etc/amanda/daily/amanda.conf

Amanda Network Settings

# Configure network encryption (recommended)
cat <<'EOF' | sudo tee /etc/amanda/daily/amanda-network.conf
# Use SSH for all client connections
bsd_security_options = ssh
ssh_keys = /var/lib/amanda/.ssh/id_rsa
EOF

# Generate SSH keys for amanda user
sudo -u amanda ssh-keygen -t rsa -f /var/lib/amanda/.ssh/id_rsa -N ""

# Copy public key to all clients for password-less SSH
# Manually or via ansible

Disklist and Host Management

Configuring Disklist

Create /etc/amanda/daily/disklist file:

cat <<'EOF' | sudo tee /etc/amanda/daily/disklist
# Disklist format: hostname diskname dumptype [interface [skip-full [skip-incr]]]

# Production servers
server1.example.com  /home     default
server1.example.com  /var      default
server1.example.com  /opt      default

# Database server with custom type
db-server.example.com  /var/lib/mysql    database-full
db-server.example.com  /var/lib/pgsql    database-full

# Web servers
web1.example.com  /var/www   default
web2.example.com  /var/www   default

# File server
storage.example.com  /data1   large-archive
storage.example.com  /data2   large-archive
EOF

sudo chown amanda:amanda /etc/amanda/daily/disklist
sudo chmod 640 /etc/amanda/daily/disklist

Custom Dump Types

Define specialized backup configurations:

cat <<'EOF' | sudo tee -a /etc/amanda/daily/amanda.conf

# Database backup type - preserve data with minimal compression
dumptype database-full {
  priority = high
  compress = none
  estimate = none
  holdingdisk = yes
  ignore-client-error = yes
  exclude list = "/etc/amanda/daily/exclude.db"
}

# Large archive type - heavy compression, low priority
dumptype large-archive {
  priority = low
  compress = server
  estimate = calcsize
  holdingdisk = no
  exclude list = "/etc/amanda/daily/exclude.archive"
}

# Critical systems - multiple backup copies
dumptype critical {
  priority = high
  compress = server
  estimate = calcsize
  holdingdisk = yes
  min-dle-by-time = 0
}
EOF

Backup Scheduling

Amanda Schedule Configuration

Configure /etc/amanda/daily/tapetype and scheduling:

# Advanced scheduling configuration
cat <<'EOF' >> /etc/amanda/daily/amanda.conf

# Retention cycles
# Keep 10 tapes in rotation
tapecycle = 10

# Full backup frequency: every Friday night
# Incrementals: every other night

schedule FullDailySchedule {
  skip-full = no
  skip-incr = yes
}

schedule IncrementalSchedule {
  skip-full = yes
  skip-incr = no
}

# Define full backup day
define dumptype full-backup {
  priority = medium
  compress = server
  estimate = calcsize
  holdingdisk = yes
}

define dumptype incremental-backup {
  priority = medium
  compress = server
  estimate = calcsize
  holdingdisk = yes
}
EOF

Cron-Based Backup Scheduling

# Schedule daily backup run
cat <<'EOF' | sudo tee /etc/cron.d/amanda
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Daily backup at 1:30 AM
30 1 * * * amanda /usr/sbin/amdump /etc/amanda/daily

# Sunday full backup at 1:30 AM
30 1 * * 0 amanda /usr/sbin/amdump /etc/amanda/daily

# Backup report at 7:00 AM
00 7 * * * amanda /usr/sbin/amreport /etc/amanda/daily
EOF

# Verify cron job
sudo crontab -u amanda -l

Backup Operations

Running Manual Backups

# Perform backup immediately
sudo -u amanda /usr/sbin/amdump /etc/amanda/daily

# Monitor backup progress
tail -f /var/log/amanda/daily/amdump.log

# Check status while backup runs
sudo amcheck /etc/amanda/daily

# Get detailed status
sudo -u amanda /usr/sbin/amstat /etc/amanda/daily

# Taper status (tape writing)
sudo -u amanda tail -f /var/log/amanda/daily/taperlog

Backup Pre-flight Checks

# Run amcheck to verify configuration
sudo amcheck /etc/amanda/daily

# Test all client connections
sudo amcheck -m /etc/amanda/daily

# Verbose checking with email report
sudo amcheck -A -m /etc/amanda/daily 2>&1 | mail -s "Amanda Check" [email protected]

Generating Backup Reports

# Generate standard report
sudo -u amanda /usr/sbin/amreport /etc/amanda/daily

# Email report
sudo -u amanda /usr/sbin/amreport /etc/amanda/daily | \
  mail -s "Backup Report $(date +%Y-%m-%d)" [email protected]

# Detailed statistics
sudo -u amanda /usr/sbin/amreport /etc/amanda/daily -i

# Generate report for specific date
sudo -u amanda /usr/sbin/amreport /etc/amanda/daily --print-stats -l 20240101

Recovery Procedures

Using amrecover Interface

# Launch recovery tool
sudo amrecover -s backup-server /etc/amanda/daily

# Within amrecover:
# Interactive commands:
# - sethost hostname             Set target for recovery
# - setdisk /path               Select filesystem
# - settape <tape-label>        Specify tape
# - mode smb|ftp|tar            Set recovery method
# - add filename                Queue file for recovery
# - adddir directory            Queue entire directory
# - delete file/dir             Remove from queue
# - list                        Show queued files
# - extract                     Perform recovery
# - quit                        Exit amrecover

File-Level Restore

# Start recovery session
sudo amrecover -s backup-server /etc/amanda/daily

# Within amrecover:
sethost server1.example.com
setdisk /home
listhost                    # List backup dates
settape daily-01
cd /important_data
add ./critical_file.txt
extract                     # Restore to /tmp/amanda-restore by default

# Exit
quit

# Files restored to /tmp/amanda-restore/
ls -la /tmp/amanda-restore/home/important_data/

Full System Restore

# For complete filesystem recovery
sudo amrecover -s backup-server /etc/amanda/daily

# Within session:
sethost server1.example.com
setdisk /
settape daily-01

# Add entire filesystem
adddir /
mode tar                   # Use tar mode for full restore

extract                    # Begins recovery

# Monitor recovery progress
tail -f /var/log/amanda/amrecover.log

Command-Line Restore

# Direct tape access for recovery
sudo amrestore -t /dev/nst0 - server1.example.com /home | \
  tar -xf - -C /tmp/recovery/

# Or using amfetchdump
sudo amfetchdump /etc/amanda/daily server1.example.com /home | \
  tar -xf - -C /tmp/recovery/

# Verify recovered files
ls -laR /tmp/recovery/

Monitoring and Maintenance

Tape Management

# List all tapes in rotation
sudo amtapelist /etc/amanda/daily

# Show tape inventory
sudo amlabel -l /etc/amanda/daily

# Label new tapes
sudo amlabel /etc/amanda/daily daily-11

# Inventory specific tape
sudo amtapelist -L daily-01 /etc/amanda/daily

# Archive full tapes for long-term storage
sudo amarchiver /etc/amanda/daily daily-01

Database and Catalog Maintenance

# Check Amanda database integrity
sudo amcheck -a /etc/amanda/daily

# Rebuild index database
sudo amindexd /etc/amanda/daily

# Cleanup old logs
find /var/log/amanda/daily -name "*.log" -mtime +30 -delete

# Verify catalog
sudo -u amanda /usr/sbin/amrestore -h /etc/amanda/daily

Performance Monitoring

# View backup performance metrics
cat /var/log/amanda/daily/amdump.log | grep -E "estimate|dump|taper"

# Monitor holding disk usage
du -h /var/lib/amanda/daily

# Check dumper performance
sudo -u amanda /usr/sbin/amtapelist /etc/amanda/daily

# Network performance during backup
nload
iotop

Conclusion

Amanda provides a sophisticated, battle-tested backup system for complex enterprise environments. By carefully configuring disklists, dumptype definitions, and scheduling strategies, organizations achieve comprehensive data protection aligned with specific recovery objectives. Amanda's concurrent multi-client backup capability and flexible recovery options ensure rapid restoration when disasters occur. Rigorous pre-flight checks and regular recovery testing validate backup reliability, making Amanda an excellent choice for mission-critical backup infrastructure requiring robust, scalable data protection.