Setup and Configuration with Bacula

For detailed information on Bacula, please read the documentation at Bacula Docs. The project has a good HOWTO and covers the architecture in detail. Most issues I ran into were resolved by reading the docs.

Pre-Setup

I am using a 100g drive (file based backup) with Red Hat Linux as the main server and PostgreSQL as the catalog repository. Postgres was already installed for a different project, so I created a new database for Bacula. The clients are OpenSolaris 11, Mac OSX, and Windows XP.

ADDED NEW DISK FOR BACKUP

I had a 200g hard drive, but was only using 100g. These are the commands I used to create a new filesystem for backup using LVM on Red Hat.

# Initialize disk for use with LVM
pvcreate /dev/hda3

# Extend the Volume Group with new partition
vgextend VolGroup00 /dev/hda3

# Create a new volume for use.
lvcreate -I 8 -L 100000 VolGroup00

# Create a filesystem on the new volume
mkfs -t ext3 /dev/VolGroup00/lvol0

# Add new filesystem to /etc/vfstab
/dev/VolGroup00/lvol0 /backup ext3 defaults 0 0

# Create /backup and mount filesystem
mkdir /backup; mount /backup

CONFIGURED BACULA

With the filesystem created, Bacula was ready to be compiled and installed.

I am using Bacula verion 2.0.3. These are the configure options I used: # Used so the compiler can link Postgres libs
export LD_LIBRARY_PATH=/usr/local/pgsql/lib:/usr/lib:/usr/local/lib
export CFLAGS="-g -O2 -Wall -L/usr/local/pgsql/lib"
# The pre-processor needs to know where to search for Postgres include files
export CPPFLAGS="-I/usr/local/pgsql/include"

     ./configure \
     --sbindir=$HOME/bin \
     --sysconfdir=$HOME/bin \
     --with-pid-dir=$HOME/bin/working \
     --with-subsys-dir=$HOME/bin/working \
     --enable-smartalloc \
     --with-python \
     --with-openssl \
     --with-readline \
     --with-postgresql=/usr/local/pgsql \
     --with-working-dir=$HOME/bin/working \
     --with-dump-email=bacula \
     --with-job-email=bacula@tmpdomain.com \
     --with-smtp-host=backup.tmpdomain.com

Next, I ran make, make install. After Bacula was installed, I ran ${Bacula_Install_Dir}/bin/create_postgresql_database, ${Bacula_Install_Dir}/bin/make_postgresql_tables, ${Bacula_Install_Dir}/bin/grant_postgresql_privileges. I followed the documentation examples, and was able to backup and restore locally without issues. Here is the finished bacula-dir.conf.

Configuring Bacula on MAC OSX

These are the steps I took to configure bacula on a Mac.
     ./configure --enable-client-only
     make
     make install
Here is a copy of the MAC bacula-fd.conf.

Configuring Bacula on OpenSolaris

The steps for configuring the client are the same, and you can use the same bacula-fd.conf as above.
     ./configure --enable-client-only
     make
     make install

I copied /etc/bacula/bacula-ctl-fd to /lib/svc/method, and changed the vaules of FD_USER and FD_GROUP to root. Here is an example svc-bacula. Add bacula.xml to /var/svc/manifest/application Next, run these commands:

     cd /var/svc/manifest/application
     xmllint bacula.xml
     svccfg import bacula.xml
     svcadm enable bacula
     svcs bacula

STATE STIME FMRI
online 16:53:17 svc:/application/bacula:default

IPTABLES

Iptables restricted the client's connection to the backup server. I edited /etc/sysconfig/iptables:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9103 -j ACCEPT

Then ran this command:

service iptables restart

At this point, Bacula is able to backup and restore to both systems.