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.
- Now, it is up to you if you want to use dedicated drives for this (which is best) however you can also attach virtual disks such you can use one disk for Truenas dataset backups and for PBS backups. This is what I am currently running in my home lab at least.
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
- Log in to your TrueNAS Web UI.
- Navigate to Datasets on the left sidebar.
- Select the parent dataset or pool where you want the backups to live.
- Click Add Dataset (top right).
- Name:
pbs-storage(or your preferred name). - Dataset Preset: Select Generic.
-
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.
- Go to System Settings → Shell or use SSH
- If using the web shell use
sudoof if you are notrootuser - Go into the new dataset
cd /mnt/tank/pbs-storage/ - Create the directory:
mkdir datastore1 - Set Backup Owner For Container
chown -R 2147000035:2147000035 datastore1 - 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.
- Go your backup PVE's shell and nano into /etc/pve/qemu-server/VM-ID.conf
- In here you want to add serial numbers to the disks that you added to the VM
- 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