Using Borg on TrueNAS
I installed TrueNAS a couple months ago to try out ZFS. It has some simple backup options built-in but I didn’t see any encrypted options. Since I use Borg elsewhere I thought this was a good opportunity to figure out how to put it on TrueNAS. TrueNAS is based on Debian, but relying on direct package installations isn’t recommended so I needed another option.
I was going to use TrueCharts’ borg chart but TrueNAS SCALE is phasing out support for charts completely so I opted to install a binary manually and see if a standard approach appears later. It turned out to be pretty straight forward, steps below:
- Download a borg binary.
You’ll want to use a version of the unfortunately-named
borg-linuxnewer64builds which are built for Debian 12. I used the latest stable version,1.2.8. - Copy the binary somewhere. I put it in
/mnt/bin/. - Try to run
/mnt/bin/borg -V. If you get an error saying/mnt/bin/borg: error while loading shared libraries: libz.so.1: failed to map segment from shared objectyou need to add a temp directory it can write to. I made/mnt/tmpand then ranexport TMPDIR="/mnt/tmp".
Now /mnt/bin/borg -V should work and you can add it to whatever scripts you
use to backup your system. Don’t forget to set the TMPDIR in your scripts too.