Intro
I found there to be a lack of good guides online for installing Bacula as a SD in a FreeNAS jail. This prompted me to create this blog to hopefully help others in the same situation.
I won’t go over installing FreeNAS. It is out of the scope of this blog. I am going to assume the following are set up in your FreeNAS:
- Disk Volumes are created
- Datasets are created
- Any redundancy if required is configured
Jails Configuration
First we must configure the jails to point to the dataset where your jails root directories will be.
Add a Jail
Click on the Add Jail button to open the window to create a new jail. Enter the name of the jail and click OK. To edit more settings such as network or auto start settings click on Advanced Mode.
In the screenshot below you will see the buttons to start/stop your jail as well as access the terminal.
Power on your new jail and access the terminal.
Downloading the source
Due to the version of bacula in pkg being very old (7.4.7) I decided to compile bacula from source. My dir server is using version 9.0.8 however the following should apply to most versions of bacula.
Issue the following commands in the terminal to download and extract the source files:
$ pkg install wget
$ cd /root
$ wget https://downloads.sourceforge.net/project/bacula/bacula/9.0.8/bacula-9.0.8.tar.gz
$ tar zxvf bacula-9.0.8.tar.gz
$ cd bacula-9.0.8
Set your configuration parameters
In the folder above you must configure options for compiling and installing bacula. A full list of configuration options can be found at Bacula’s main webpage under Documentation. Here is a link for version 9.0.X.
Since I am configuring this as a storage daemon only server my options were as follows:
$ ./configure\-disable-build-dird\-enable-build-stored\-with-sqlite3
The options above were selected for the following reasons:
-disable-build-dird
Does not compile the bacula-dir daemon
-enable-build-stored
This is on be default but I included it anyways. It will make sure the bacula-sd daemon is compiled.
-with-sqlite3
This is because a DB must be defined. If not you must use the option -enable-client-only however that will only compile the bacula-fd daemon not bacula-sd/
Verifying the ./configure options
The output from ./configure is stored in config.out and can be re-displayed at any time without rerunning the ./configure by issuing the command:
$ cat config.out.
Compiling and Installing
To compile and install enter the following commands:
$ make
$ make install
Installing Auto Start scripts
To install the auto start scripts enter the following:
make install-autostart
They will be installed here: /etc/rc.bacula-*
Starting Over
If you’ve made a mistake you can uninstall and delete the configuration settings.
To uninstall:
make uninstall
To delete compile configuration:
make distclean
Configuration
Configuration can be found in the /etc/bacula folder.
Troubleshooting
The following command can be used for troubleshooting startup issues:
/sbin/bacula-sd $2 -c /etc/bacula/bacula-sd.conf -d 400
43.714942
-79.683876