4. PBS Container on TrueNas Scale

Here we will setup PBS on top of Truenas Scale as a container. Why would you do this ? well if you run both proxmox pve and run a Truenas VM or bare metal then you have two different systems to backup. You want to backup your VM's and you want to back up your TrueNas datasets. Both are optimised for running a second bare metal Proxmox PBS and a bare metal Truenas instance. However, this means you need to get two devices. The middle ground is get 1 extra host where TrueNas and PBS both have direct access to the zfs pools instead of having ZFS on top of ZFS.

Now, ZFS on top of ZFS happens if you have a second PVE instance on which you run a PBS and TrueNas Scale VM. Then you need at a minimum at least 2 drives one to pass through to the PBS VM and one to the TrueNas VM. If you only have one storage drive

Source: Why run PBS on Truenas ?

1. Introduction

Note! Running another Truenas on bare metal also allows you to run proxmox pbs as a container! If you have just as me one production device and a small backup server with like 4cpus and 16gb of ram then this would be great solution for you. Otherwise you need to have at least 3 devices. 

This method involves backing up your Truenas datasets to another Truenas VM running on another host. 

2. Installation

Source: PBS on Truenas by Lawrence Systems

Alright! So you have chosen to install PBS on top of a TrueNas Scale bare metal instance. Well we don't need to go through installing TrueNas scale since you have already don that here Installing TrueNas Scale. Okey so you have your TrueNas scale up and running then this will be the steps

Creating a generic dataset for your PBS container

  1. Log in to your TrueNAS Web UI.
  2. Navigate to Datasets on the left sidebar.
  3. Select the parent dataset or pool where you want the backups to live.
  4. Click Add Dataset (top right).
  5. Name: pbs-storage (or your preferred name).
  6. Dataset Preset: Select Generic.
  7. Click Save.

In TrueNAS Create the Subdirectory and Set ACLs

Working in a subdirectory prevents PBS from conflicting with any special folders and let’s set and limit user permission. We will perform this in the TrueNAS Shell.

  1. Go to System SettingsShell or use SSH
  2. If using the web shell use sudo of if you are not root user
  3. Go into the new dataset cd /mnt/tank/pbs-storage/
  4. Create the directory:mkdir datastore1
  5. Set Backup Owner For Container chown -R 2147000035:2147000035 datastore1
  6. Apply the Access ACL & Default ACL (Inheritance): setfacl -m u:2147000035:rwx,d:u:2147000035:rwx datastore1
Where do the permissions come from ?

In TrueNAS 25, the default mapping for unprivileged containers starts at 2147000001.


If you are… ID in the Container ID on the TrueNAS Host
Root User 0 2147000001
PBS Backup User 34 2147000035
Standard User 1000 2147010001

Truenas VM with virtual drives

If you want to go the virtual drive route then there is one little tweak that you need  to make for TrueNas VM to recognize different drives. 

  1. Go your backup PVE's shell and nano into /etc/pve/qemu-server/VM-ID.conf
  2. In here you want to add serial numbers to the disks that you added to the VM
  3. This does not need to be complicated, they just need to be different for each drive. For instance you could use serial=DRIVE00X for each drive and changing X for each added drive. For instance with two drives it looks like this 
scsi0: local-zfs:vm-1002-disk-0,discard=on,iothread=1,size=12G,ssd=1,serial=DISK001
scsi1: tank:vm-1002-disk-1,discard=on,iothread=1,size=2000G,ssd=1,serial=DISK002