Tony Fernandez

The Packets Never Lie

BackupPC on FreeNAS with RSync — June 3, 2019

BackupPC on FreeNAS with RSync

I’ve recently got working a jail on my FreeNAS 11.2 server that is running BackupPC version 4. I followed a great guide by blanchet on the ixsystems forums. Link is below in the References. Blanchet configured his instance to use smb however I opted to use rsync instead. It required a bit more configuration that was not included so I wanted to add it here.

SSH Keys

For this to work we are going to need to create an SSH key on the BackupPC server and load that onto the remote PC to be backed up.
root@backuppc-4:~ # ssh-keygen
Press enter to get through all the prompts. Assuming you are logged in as root, this will create the following files

  • /root/.ssh/id_rsa
  • /root/.ssh/id_rsa.pub

You’ll need to append the contents of the id_rsa.pub file to the remote PC’s authorized_keys file. The authorized_keys file can be found in either:

/home/.ssh/autorized_keys

OR

/root/.ssh/autorized_keys

Continue reading

Bacula Storage Daemon on FreeNAS — October 22, 2018

Bacula Storage Daemon on FreeNAS

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.

jails-config

 

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.

start-stop-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
Design a site like this with WordPress.com
Get started