Using Bacula to backup a Mox

I use Bacula to backup all of my systems for daily incremental, weekly differential and monthly full backups. I have long been annoyed that there is no bacula client for openwrt.

I am running a VM in an LXC container on my Mox and I have been using Bacula to backup that VM. It occurred to me today that I could mount the Mox root file system onto a directory inside the VM and then use Bacula to backup that directory giving me a backup of the whole root file system, not just the configuration files.

After installing the LXC container I make a directory /moxroot in that container and then put his command in /etc/rc.local.

mount -o subvol=/@ -o bind / /srv/lxc/mini/rootfs/moxroot

It didn’t work when I put that in /etc/config/fstab because mount complains “block: /dev/mmcblk1p1 is already mounted on /” or “new mount options do not match the existing superblock, will be ignored”

The container is named “mini” so that is where it’s root file system. When I run the backup of mini if I include the directory /moxroot then the mox root file system gets backed up.

Now I will have daily backups of the whole mox root file system. This process should work with any program you use to backup the LXC VM not just Bacula.

Bill