Skip to main content

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.

  • Base ID: 2147000001 (This is the “Start” of the container’s world).
  • Root (0) inside the container: 2147000001 + 0 = 2147000001 on the Host.
  • Backup (34) inside the container: 2147000001 + 34 = 2147000035 on the Host.
  • Standard User (1000) inside the container: 2147000001 + 1000 = 2147010001 on the Host.

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