Suppose you have a brand new machine with a nice SCSI U320 controller and a nice tape library with some LTO-3 drives. That’s quite a lot of expensive hardware; now let’s put it to good use with just Free Software!
The official Bacula manual is quite good, but it is very verbose and the organization is not straightforward, so it is advisable to read the whole thing and figure out which steps apply to your setup. Hopefully, this guide serves as a bit of a shortcut.
I assume a minimal Centos5 install. I do the minimal install by unchecking every single component in the CentOS5 installer, even “Base”. This gets me down to a lean ~147 packages. After the install, do a ‘yum -y upgrade’ and a ‘yum install vim-enhanced yum-updatesd yum-protectbase which ntp net-snmp krb5-workstation logwatch sysstat rsync man logrotate mlocate smartmontools strace rcs gnupg crontabs eject wget”. Then install the epel-release RPM with ‘rpm -Uvh epel-release‘.
Now you have access to bacula packages. Do a ‘yum install bacula-storage-mysql bacula-director-mysql bacula-console bacula-client’ That will also pull in mysql-server. Do a ‘cp /usr/share/doc/mysql-server-5.0.22/my-large.cnf /etc/my.cnf’ and then uncomment the skip-networking directive there for some added security. Next, we
mysqladmin -u root password 'something'
mysqladmin -u root -p -h FQDN password 'something'
mysqladmin -u root -p create bacula
mysql -u root -p
grant all on bacula.* to bacula@localhost identified by 'baculapassword';
mysqladmin -u root -p reload
/usr/libexec/bacula/make_mysql_tables -u root -p
Now the MySQL portion is set up. I’ve also made sure my autochanger works from Linux with commands like ‘mt -f /dev/nst0′ and ‘tapeinfo -f /dev/sg1′ and ‘mtx -f /dev/sg3 status’. Then we want to run btest, but first we must write a bacula-sd.conf.
Since my autochanger is almost exactly like the one in the supplied /etc/bacula/bacula-sd.conf, I basically just uncomment the Autochanger directive and the two Device drives and I’m good to go. I also had to specify the full path to mtx-changer: /usr/libexec/bacula/mtx-changer
Then work with the btape program to get your autochanger working correctly with the ‘test’ and ‘auto’ commands in btape.