UrBackup on Scale - Custom settings install

EdW

Cadet
Joined
Jan 23, 2022
Messages
4
Hello,

I am a new to this forum. I just wanted to share my settings or instructions on how to install Urbackup on scale using the "Launch Docker Image" in applications.

1. Create a location on one of your local disks (on Scale) to backup your images and files. I have a 4TB disk for VM/Computer backups.

2. Go to Applications and click on the blue "Launch Docker Image".

3. Application name: urbackup (or whatever you want)

4. Container Images: uroni/urbackup-server - latest

5. Add - Ports:
1 - Port forwarding Container port:55413 - Node Port 55413 - TCP
2 - Port forwarding Container port:55414 - Node Port 55414 - TCP
3 - Port forwarding Container port:55415 - Node Port 55415 - TCP
4 - Port forwarding Container port:35623 - Node Port 35623 - UDP

6. Storage: (see image) - Replace your mounted disk for backups

1 - Configure Host Path to your created location from above.
2 - Add volume to /media/backups
3 - Add volume to /media/database

1642977307805.png


7. Click Save and type in your TrueNAS Scale IP:55414

8. Add a user/pass to protect the site.

Hope this helps someone.

Ed.
 

Milkysunshine

Dabbler
Joined
Mar 1, 2022
Messages
16
I did not need to add the volumes. I simply added the host path and it worked fine. I did need to change my config in urbackup web gui to use /mnt/TrueNAS as a backup location
 
Last edited:

Milkysunshine

Dabbler
Joined
Mar 1, 2022
Messages
16
Apparantly, I did need to add the volumes. Settings didn't persist after restart of service.

Also, I had to change the volumes' mount paths. the database mount point should be /var/urbackup and backup should be /backups
 
Last edited:

ncrypto

Cadet
Joined
Jan 12, 2022
Messages
2
Hello, i'm very new to truenas-urbackup-docker-kubernetes, but a little knowledge of linux in general. I've been trying to make it work with this instructions and i can't make it. It seems to start ok as i configured it, or thought i did right, and instead of putting backups from computers and files inside the path i configured, it just put them inside /mnt/MyPool/ix-applications. If i reboot it with some change, all config, files and everything just deletes and starts from scratch on start.
This is my configuration, its different from @EdW because i tried exactly what he did and it didn't work so i tried something different somebody told me to change at libera irc #truenas support channel
urbackup-container-setup.png

This are the shares i created and permissions:
shares-perms.jpg

There is 777 permissions on urbackup share just to try if it where a permission problem, also suggested by crbp from irc.
This is my urbackup container log:
2022-05-10T04:49:37.226158819Z usermod: no changes
2022-05-10T04:49:38.967068516Z Raising nice-ceiling to 35 failed. (errno=1)
2022-05-10T04:49:38.968355616Z 2022-05-10 04:49:38: Starting HTTP-Server on port 55414
2022-05-10T04:49:38.968445024Z 2022-05-10 04:49:38: HTTP: Server started up successfully!
2022-05-10T04:49:38.969846152Z 2022-05-10 04:49:38: Generating Server identity...
2022-05-10T04:49:38.970339013Z 2022-05-10 04:49:38: Generating Server private/public ECDSA key...
2022-05-10T04:49:38.972582467Z 2022-05-10 04:49:38: Calculating public key...
2022-05-10T04:49:39.178571682Z 2022-05-10 04:49:39: Generating Server private/public DSA key...
2022-05-10T04:49:39.201037154Z 2022-05-10 04:49:39: Calculating public key...
2022-05-10T04:49:39.223215722Z 2022-05-10 04:49:39: Generating Server token...
2022-05-10T04:49:39.227690900Z 2022-05-10 04:49:39: WARNING: Upgrading...
2022-05-10T04:49:39.228058898Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 8
2022-05-10T04:49:39.462604469Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 9
2022-05-10T04:49:39.555316514Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 10
2022-05-10T04:49:39.598008953Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 11
2022-05-10T04:49:39.640761130Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 12
2022-05-10T04:49:39.683930287Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 13
2022-05-10T04:49:39.729616184Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 14
2022-05-10T04:49:39.770894190Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 15
2022-05-10T04:49:39.832094399Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 16
2022-05-10T04:49:39.893084853Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 17
2022-05-10T04:49:39.934150709Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 18
2022-05-10T04:49:39.975027704Z 2022-05-10 04:49:39: WARNING: Upgrading database to version 19
2022-05-10T04:49:40.016092501Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 20
2022-05-10T04:49:40.091221396Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 21
2022-05-10T04:49:40.151774218Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 22
2022-05-10T04:49:40.192086447Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 23
2022-05-10T04:49:40.232987836Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 24
2022-05-10T04:49:40.273870175Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 25
2022-05-10T04:49:40.314470167Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 26
2022-05-10T04:49:40.385433235Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 27
2022-05-10T04:49:40.426828928Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 28
2022-05-10T04:49:40.487764331Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 29
2022-05-10T04:49:40.528412773Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 30
2022-05-10T04:49:40.589551056Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 31
2022-05-10T04:49:40.650923403Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 32
2022-05-10T04:49:40.691605666Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 33
2022-05-10T04:49:40.732443943Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 34
2022-05-10T04:49:40.773038162Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 35
2022-05-10T04:49:40.815349176Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 36
2022-05-10T04:49:40.933561342Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 37
2022-05-10T04:49:40.975807205Z 2022-05-10 04:49:40: WARNING: Upgrading database to version 38
2022-05-10T04:49:41.018811348Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 39
2022-05-10T04:49:41.062875106Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 40
2022-05-10T04:49:41.108013615Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 41
2022-05-10T04:49:41.170763860Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 42
2022-05-10T04:49:41.212028200Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 43
2022-05-10T04:49:41.273884876Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 44
2022-05-10T04:49:41.315089291Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 45
2022-05-10T04:49:41.449463847Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 46
2022-05-10T04:49:41.490328735Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 48
2022-05-10T04:49:41.583223987Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 49
2022-05-10T04:49:41.623935142Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 50
2022-05-10T04:49:41.666051662Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 51
2022-05-10T04:49:41.706816354Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 52
2022-05-10T04:49:41.747654654Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 53
2022-05-10T04:49:41.808708352Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 54
2022-05-10T04:49:41.900984169Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 55
2022-05-10T04:49:41.940594229Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 56
2022-05-10T04:49:41.981819598Z 2022-05-10 04:49:41: WARNING: Upgrading database to version 57
2022-05-10T04:49:42.022615021Z 2022-05-10 04:49:42: WARNING: Upgrading database to version 58
2022-05-10T04:49:42.063589138Z 2022-05-10 04:49:42: WARNING: Upgrading database to version 59
2022-05-10T04:49:42.124678798Z 2022-05-10 04:49:42: WARNING: Done.
2022-05-10T04:49:42.258338901Z 2022-05-10 04:49:42: Deleting database journal...
2022-05-10T04:49:42.281225931Z 2022-05-10 04:49:42: Copying/reflinking database...
2022-05-10T04:49:42.281272839Z 2022-05-10 04:49:42: Reflink ioctl failed. errno=95
2022-05-10T04:49:42.281283517Z 2022-05-10 04:49:42: WARNING: Creating file entry index. This might take a while...
2022-05-10T04:49:42.281297415Z 2022-05-10 04:49:42: Getting number of files...
2022-05-10T04:49:42.281305982Z 2022-05-10 04:49:42: Dropping index...
2022-05-10T04:49:42.281313792Z 2022-05-10 04:49:42: Starting creating files index...
2022-05-10T04:49:42.281321537Z 2022-05-10 04:49:42: Creating backupid index...
2022-05-10T04:49:42.281341693Z 2022-05-10 04:49:42: Syncing...
2022-05-10T04:49:42.291341589Z 2022-05-10 04:49:42: Renaming back result...
2022-05-10T04:49:42.420519631Z 2022-05-10 04:49:42: SQLite: recovered 1 frames from WAL file /var/urbackup/backup_server.db-wal code: 283
2022-05-10T04:49:42.420545328Z 2022-05-10 04:49:42: SQLite: recovered 2 frames from WAL file /var/urbackup/backup_server_settings.db-wal code: 283
2022-05-10T04:49:42.573881338Z 2022-05-10 04:49:42: Started UrBackup...
2022-05-10T04:49:42.573906562Z 2022-05-10 04:49:42: Removing temporary files...
2022-05-10T04:49:42.573931105Z 2022-05-10 04:49:42: ERROR: No permission to access "/backups/urbackup_tmp_files"
2022-05-10T04:49:42.573940715Z 2022-05-10 04:49:42: Recreating temporary folder...
2022-05-10T04:49:42.574213033Z TEST FAILED: guestmount is missing (libguestfs-tools)
2022-05-10T04:49:42.578294778Z 2022-05-10 04:49:42: Image mounting disabled: TEST FAILED: guestmount is missing (libguestfs-tools)
2022-05-10T04:49:42.579643910Z Testing for btrfs...
2022-05-10T04:49:42.584502986Z ERROR: not a btrfs filesystem: /backups/testA54hj5luZtlorr494
2022-05-10T04:49:42.584642124Z TEST FAILED: Creating test btrfs subvolume failed
2022-05-10T04:49:42.584673762Z Testing for zfs...
2022-05-10T04:49:42.584683579Z TEST FAILED: Dataset is not set via /etc/urbackup/dataset
2022-05-10T04:49:42.584921775Z 2022-05-10 04:49:42: Backup destination cannot handle subvolumes and snapshots. Snapshots disabled.
2022-05-10T04:49:42.585470538Z 2022-05-10 04:49:42: Reflink ioctl failed. errno=95
2022-05-10T04:49:43.074173377Z 2022-05-10 04:49:43: UrBackup Server start up complete.
2022-05-10T04:49:43.074197343Z 2022-05-10 04:49:43: Server started up successfully!
2022-05-10T04:49:43.074207079Z 2022-05-10 04:49:43: Looking for old Sessions... 0 sessions
2022-05-10T04:49:44.082459959Z 2022-05-10 04:49:44: Downloading version file...
2022-05-10T04:49:44.962498274Z 2022-05-10 04:49:44: Downloading signature...
2022-05-10T04:49:45.379348845Z 2022-05-10 04:49:45: Downloading old signature...
2022-05-10T04:49:45.863458806Z 2022-05-10 04:49:45: Getting update file URL...
2022-05-10T04:49:46.273702912Z 2022-05-10 04:49:46: Downloading update file...
2022-05-10T04:49:48.655715810Z 2022-05-10 04:49:48: Broadcasting on ipv4 interface eth0 addr 172.17.0.38
2022-05-10T04:49:49.118644457Z 2022-05-10 04:49:49: Successfully downloaded update file.
2022-05-10T04:49:49.118666033Z 2022-05-10 04:49:49: Downloading version file...
2022-05-10T04:49:49.526278081Z 2022-05-10 04:49:49: Downloading signature...
2022-05-10T04:49:49.934799333Z 2022-05-10 04:49:49: Getting update file URL...
2022-05-10T04:49:50.347360520Z 2022-05-10 04:49:50: Downloading update file...
2022-05-10T04:49:52.236273769Z 2022-05-10 04:49:52: Successfully downloaded update file.
2022-05-10T04:49:52.236296931Z 2022-05-10 04:49:52: Downloading server version info...
2022-05-10T04:49:52.652842151Z 2022-05-10 04:49:52: Downloading dataplan database...

and this is a log from host console:
░░ The job identifier is 132420.
May 10 00:00:08 truenas.myoffice.loc syslog-ng[5409]: DIGEST-MD5 common mech free
May 10 00:00:08 truenas.myoffice.loc collectd[1164561]: Traceback (most recent call last):
File "/usr/local/lib/collectd_pyplugins/nfsstat.py", line 23, in read
with open("/proc/net/rpc/nfsd", "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/proc/net/rpc/nfsd'
May 10 00:00:18 truenas.myoffice.loc collectd[1164561]: Traceback (most recent call last):
File "/usr/local/lib/collectd_pyplugins/nfsstat.py", line 23, in read
with open("/proc/net/rpc/nfsd", "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/proc/net/rpc/nfsd'
May 10 00:00:28 truenas.myoffice.loc collectd[1164561]: Traceback (most recent call last):
File "/usr/local/lib/collectd_pyplugins/nfsstat.py", line 23, in read
with open("/proc/net/rpc/nfsd", "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/proc/net/rpc/nfsd'
May 10 00:00:36 truenas.myoffice.loc k3s[12493]: I0509 22:00:36.979872 12493 trace.go:205] Trace[1776202181]: "Get" url:/api/v1/namespaces/ix-urbackup/pods/urbackup->
May 10 00:00:36 truenas.myoffice.loc k3s[12493]: Trace[1776202181]: ---"Transformed response object" 50839ms (22:00:00.979)
May 10 00:00:36 truenas.myoffice.loc k3s[12493]: Trace[1776202181]: [50.841051101s] [50.841051101s] END
May 10 00:00:37 truenas.myoffice.loc k3s[12493]: I0509 22:00:37.000440 12493 log.go:181] http: superfluous response.WriteHeader call from k8s.io/apiserver/pkg/server>
May 10 00:00:38 truenas.myoffice.loc collectd[1164561]: Traceback (most recent call last):
File "/usr/local/lib/collectd_pyplugins/nfsstat.py", line 23, in read
with open("/proc/net/rpc/nfsd", "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/proc/net/rpc/nfsd'

Directories inside urbackup docker container:
# ls -la /
total 83
drwxr-xr-x 24 root root 25 May 10 04:49 .
drwxr-xr-x 24 root root 25 May 10 04:49 ..
-rwxr-xr-x 1 root root 0 May 10 04:49 .dockerenv
drwxrwxrwx 4 root root 4 May 10 01:00 backup
drwxr-xr-x 3 urbackup urbackup 3 May 10 04:49 backups
drwxr-xr-x 2 root root 86 Mar 1 22:12 bin
drwxr-xr-x 2 root root 2 Oct 3 2021 boot
drwxr-xr-x 5 root root 360 May 10 04:49 dev
drwxr-xr-x 34 root root 81 May 10 04:49 etc
drwxr-xr-x 2 root root 2 Oct 3 2021 home
drwxr-xr-x 7 root root 7 Feb 28 00:00 lib
drwxr-xr-x 2 root root 3 Feb 28 00:00 lib64
drwxr-xr-x 2 root root 2 Feb 28 00:00 media
drwxr-xr-x 2 root root 2 Feb 28 00:00 mnt
drwxr-xr-x 2 root root 2 Feb 28 00:00 opt
dr-xr-xr-x 305 root root 0 May 10 04:49 proc
drwx------ 2 root root 4 Feb 28 00:00 root
drwxr-xr-x 4 root root 5 May 10 04:49 run
drwxr-xr-x 2 root root 77 Feb 28 00:00 sbin
drwxr-xr-x 2 root root 2 Feb 28 00:00 srv
dr-xr-xr-x 13 root root 0 May 10 04:49 sys
drwxrwxrwt 2 root root 2 Feb 28 00:00 tmp
drwxr-xr-x 10 root root 10 Feb 28 00:00 usr
drwxr-xr-x 12 root root 14 Mar 1 22:12 var
drwxr-xr-x 3 root root 5 Mar 1 22:12 web-backup
# ls -R /backups
/backups:
urbackup_tmp_files

/backups/urbackup_tmp_files:
# ls -R /backup
/backup:
backups database

/backup/backups:

/backup/database:

# ls -la /var
total 47
drwxr-xr-x 12 root root 14 Mar 1 22:12 .
drwxr-xr-x 24 root root 25 May 10 04:49 ..
drwxr-xr-x 2 root root 2 Oct 3 2021 backups
drwxr-xr-x 5 root root 5 Feb 28 00:00 cache
drwxr-xr-x 7 root root 7 Feb 28 00:00 lib
drwxrwsr-x 2 root staff 2 Oct 3 2021 local
lrwxrwxrwx 1 root root 9 Feb 28 00:00 lock -> /run/lock
drwxr-xr-x 3 root root 9 May 10 04:49 log
drwxrwsr-x 2 root mail 2 Feb 28 00:00 mail
drwxr-xr-x 2 root root 2 Feb 28 00:00 opt
lrwxrwxrwx 1 root root 4 Feb 28 00:00 run -> /run
drwxr-xr-x 2 root root 3 Feb 28 00:00 spool
drwxrwxrwt 2 root root 2 Oct 3 2021 tmp
drwxr-xr-x 3 urbackup urbackup 30 May 10 04:49 urbackup
# ls -R /var/backups
/var/backups:
# ls -R /var/urbackup
/var/urbackup:
UrBackupUpdate.exe UrBackupUpdateLinux.sig2 backup_server_files.db backup_server_links.db backupfolder server_ident.priv server_token.key
UrBackupUpdate.sig backup_server.db backup_server_link_journal.db backup_server_settings.db dataplan_db.txt server_ident.pub server_version_info.properties
UrBackupUpdate.sig2 backup_server.db-shm backup_server_link_journal.db-shm backup_server_settings.db-shm fileindex server_ident_ecdsa409k1.priv version.txt
UrBackupUpdateLinux.sh backup_server.db-wal backup_server_link_journal.db-wal backup_server_settings.db-wal server_ident.key server_ident_ecdsa409k1.pub version_linux.txt

/var/urbackup/fileindex:
backup_server_files_index.lmdb backup_server_files_index.lmdb-lock

Sorry if i posted innecesary information and if i need to share more please let me know so i can post it.
I've tried searching for information but i cant find it and i would love to fix this, its driving me crazy really.

Thanks
 

Milkysunshine

Dabbler
Joined
Mar 1, 2022
Messages
16
In the UrBackup web interface, did you change the settings -> backup storage path to your mountpoint in the container?

For me, I have it set to /backups in the web gui for urbackup. In truenas, under urbackup app settings -> Storage -> Configure Host Path Volumes -> /mnt/whatever your zfs pool is/whatever your dataset is .
Then, below that in the mount path, put whatever directory you want to be mounted to in the container. (again, for me, it is /backups.)

Hope this helps
 

LMZ

Cadet
Joined
May 20, 2022
Messages
4
This is what I have and it works, but this is for anyone that does a Google Search "TrueNAS Scale Urbackup" as it's the first result for me. Just trying to help others that are searching, etc., etc.

  1. Create a pool which I called mine "data" (I'm using RAID-Z with default settings)

  2. Under your newly created pool, create a dataset called "urbackup"
    1. The main path should look like this now: /mnt/data/urbackup
    2. Create two more datasets under urbackup, which should look like this:
      1. /mnt/data/urbackup/backups <-- Your Clients backups go into this.
      2. /mnt/data/urbackup/database <-- Urbackup database stuff goes into this
    3. Default settings are fine.
  3. Click one Apps (Left panel) then click Launch Docker Image (Top Right).

  4. Fille out the information:
    1. Application Name: urbackup
    2. Container Images
      1. Image Repository: uroni/urbackup-server
      2. Image Tag: latest
    3. Container Environment Variables:
      1. Click Add by "Configure Container Environment Variables"
      2. "Environment Variable Name" TZ
      3. "Environment Variable Value" America/New_York
        Note: This sets your Container TimeZone
    4. Port Forwarding:
      1. Click Add by "Configure Specify Node ports to forward to workload" for each Port:
        1. Port Forwarding Configuration: Container Port - 55413, Node Port - 55413, Protocol - TCP.
        2. Port Forwarding Configuration: Container Port - 55414, Node Port - 55414, Protocol - TCP.
        3. Port Forwarding Configuration: Container Port - 55415, Node Port - 55415, Protocol - TCP.
        4. Port Forwarding Configuration: Container Port - 35623, Node Port - 35623, Protocol - UDP.
    5. Storage:
      1. Click Add by "Configure Host Path Volumes" for each Host Path:
        1. Host Path Configuration: Host Path "/mnt/data/urbackup/backups", Mount Path "/backups"
        2. Host Path Configuration: Host Path "/mnt/data/urbackup/database", Mount Path "/var/urbackup"
    6. Click Save.
  5. Once it has been deployed and "ACTIVE" head over to your http://[TrueNAS_IP]:55414
Screenshots from Launch Docker Image:

docker1.PNG


docker2.PNG


docker3.PNG

NOTE: There are more Ports but they're not showing up in this snip.

docker4.PNG
 

jct

Explorer
Joined
Aug 14, 2021
Messages
52
This is what I have and it works, but this is for anyone that does a Google Search "TrueNAS Scale Urbackup" as it's the first result for me. Just trying to help others that are searching, etc., etc.
But it appears that none of us yet has UrBackup's ZFS support working? That'll be key to image backups.

I've gotten as far as mounting /dev/zfs into a privileged container and installing the zfs tools to start exploring the snapshotting errors to see what hope there is for the urbackup_snapshot_helper tool from inside Docker. None of those tools are in the official UrBackup container.
 

jct

Explorer
Joined
Aug 14, 2021
Messages
52
Ah — learning some things.
After that, we'll probably need some "zfs allow" magic on the backups dataset to enable the non-root user to manage snapshots.

And then hopefully we won't require --privileged anymore?

But this does look doable.
 

jct

Explorer
Joined
Aug 14, 2021
Messages
52
Sorry; I may be the only one interested in this but I've gotten to a successful snapshot test using a new Dockerfile and no privilege mode.

Code:
% docker run --rm -it \                        
        --name urbackup \
        --device /dev/zfs \
        -e PUID=568 \
        -e PGID=568  \
        -e TZ=US/Eastern \
        -v /mnt/pool/urbackup/backups:/backups \
        -v /mnt/pool/urbackup/conf:/etc/urbackup \
        -v /mnt/pool/urbackup/index:/var/urbackup \
        --network host \
        --entrypoint /bin/bash \
        urbackup-server:zfs

root@truenas:/# urbackup_snapshot_helper test
Testing for btrfs...
TEST FAILED: Creating test btrfs subvolume failed
Testing for zfs...
ZFS TEST OK

root@truenas:/# zfs allow pool/urbackup/backups
---- Permissions on pool/urbackup/backups ----------------------------
Local+Descendent permissions:
    user (unknown: 568) change-key,clone,create,destroy,diff,hold,load-key,mount,promote,receive,release,rollback,send,snapshot
    group (unknown: 568) change-key,clone,create,destroy,diff,hold,load-key,mount,promote,receive,release,rollback,send,snapshot
    everyone change-key,clone,create,destroy,diff,hold,load-key,mount,promote,receive,release,rollback,send,snapshot


The Dockerfile isn't pretty, but seems to do the trick.
Note: because it uses newer heredoc syntax, build it with e.g. DOCKER_BUILDKIT=1 docker build . --network host -t urbackup-server:zfs

Code:
# syntax=docker/dockerfile:1.3-labs

FROM debian:buster

ARG VERSION=2.4.15
ENV VERSION ${VERSION}
ARG TARGETPLATFORM

COPY entrypoint.sh /usr/bin/
ADD https://hndl.urbackup.org/Server/${VERSION}/debian/buster/urbackup-server_${VERSION}_amd64.deb /root/urbackup-server.deb

RUN <<END_SCRIPT

cat <<end_list >/etc/apt/sources.list.d/buster-backports.list
deb http://deb.debian.org/debian buster-backports main contrib
deb-src http://deb.debian.org/debian buster-backports main contrib
end_list

    echo "urbackup-server urbackup/backuppath string /backups" \
        | debconf-set-selections

    apt-get update
    apt-get install -y --no-install-recommends \
        /root/urbackup-server.deb \
        zfsutils-linux

    rm /root/urbackup-server.deb
    apt-get clean
    rm -rf /var/lib/apt/lists/*

    cp -R /usr/share/urbackup /web-backup
    chmod +x /usr/bin/entrypoint.sh

END_SCRIPT

EXPOSE 55413
EXPOSE 55414
EXPOSE 55415
EXPOSE 35623/udp

VOLUME [ "/var/urbackup", "/var/log", "/backups" ]
ENTRYPOINT [ "/usr/bin/urbackupsrv" ]
CMD [ "run" ]
 
Last edited:

jct

Explorer
Joined
Aug 14, 2021
Messages
52
FWIW, I've tidied up and submitted a pull request for the upstream project to build with zfs support.
 

LMZ

Cadet
Joined
May 20, 2022
Messages
4
But it appears that none of us yet has UrBackup's ZFS support working? That'll be key to image backups.

I've gotten as far as mounting /dev/zfs into a privileged container and installing the zfs tools to start exploring the snapshotting errors to see what hope there is for the urbackup_snapshot_helper tool from inside Docker. None of those tools are in the official UrBackup container.
Hey Jct,

Sorry, I was out the whole weekend camping by the river (not in a van). I didn't want you to think I was ignoring you...
 
  • Haha
Reactions: jct

rlopez

Cadet
Joined
Jun 6, 2022
Messages
2
Hello,

So, can you say that Urbackup works with all ZFS functionallity on Truenas Scale doing all those steps?
 

bleomycin

Cadet
Joined
Nov 1, 2012
Messages
5
FWIW, I've tidied up and submitted a pull request for the upstream project to build with zfs support.
Wow, incredible work you've done! This is exactly what has been keeping me off truenas scale. I'm very much looking forward to this getting dialed in further!
 

jct

Explorer
Joined
Aug 14, 2021
Messages
52
My apologies: I didn't mean to leave anyone hanging. I don't happen to use UrBackup at home (or Windows for that matter) and I haven't been back to that client site due to an outbreak.

Ultimately, I think we should prep this as a TrueCharts app — but not before we get an an official ZFS-enabled build from the author.

Until that happens, here's how to build your own local copy of the container with ZFS enabled. This will involve a shell session.

Make sure your shell user account is a member of the docker group. (root is a member by default, but I'd suggest you add docker membership to your regular user account as an "auxiliary group" under Credentials, Local Users. You'll need to sign out and back in with a new shell session.) You can confirm your account's permissions by running docker ps.

Check out the branch of the code that I proposed in the pull request.
Code:
git clone https://github.com/jonct/urbackup-server-docker.git -b snapshot-build-variants

Then enter the directory with a cd urbackup-server-docker.

Build the container as follows. Don't omit that final period argument.
Code:
DOCKER_BUILDKIT=1 docker build --build-arg ZFS=1 --network=host --tag urbackup-server:2.4.15_zfs .

Explanations: specify BuildKit manually on this older version of Docker; enable ZFS; use the host's network resolver during the build because Debian containers can be a bit finicky that way; tag the container with a name that we'll reference below; perform the build within the current directory.

If the build succeeds, then you'll have a local container that you can use with the discussion above.
  • Image Repository: urbackup-server
  • Image Tag: 2.4.15_zfs
Somehow we need to pass the equivalent of --device /dev/zfs to the container runtime. I wouldn't expect that "Container Arguments" will do that. Maybe the Docker Compose shim would be a better starting point than the big blue button. That is, until we put together a proper chart app using an official container.

I'll have to defer to the rest of you on how to best configure and maintain UrBackup. Thanks for getting the ball rolling!
 
  • Like
Reactions: LMZ

Tortar

Cadet
Joined
Jul 25, 2022
Messages
1
Hello guys,
I have a question I want to enable internet mode but a reboot is required. When I stop the docker and restart it all my settings are gone how can I allow internet mode and make it so it doesn't reset my settings?
 

jct

Explorer
Joined
Aug 14, 2021
Messages
52
Good news! I got notice this morning that my Dockerfile changes were merged, alongside the release of Urbackup 2.5.25.

(First up: @Tortar, I'm not sure offhand where the UI stores its settings. That might be what the author is doing with /usr/share/urbackup, so you might try adding a volume binding for that.)

Back to the Dockerfile: now it's easier (and more officially recognized) to build your own container with ZFS enabled.
Code:
git clone https://github.com/uroni/urbackup-server-docker.git
cd urbackup-server-docker
DOCKER_BUILDKIT=1 docker build --build-arg ZFS=1 --network=host --tag urbackup-server:2.5.25_zfs .
Again: if you build that way from within your TrueNAS SCALE command shell, its big blue button can find the locally built image as follows.
  • Image Repository: urbackup-server
  • Image Tag: 2.5.25_zfs
Unfortunately there's still not a ready-made official build in Docker Hub with that option. That might just be where things stand for a while.

As to adding --device /dev/zfs that might not be necessary. Using the big blue button you should be able to mimic the same effect by mapping /dev/zfs as-is from host to container and enabling privileged mode. Or — hopefully — you can leave off privileged mode and explicitly zfs allow … a reduced set of privileges specific to the account and dataset.

And the rest is a matter of server configuration. It reads to me as if file-based backups aren't very efficient unless you can enable ZFS deduplication. I hope that's not the case with image-based backups, which to me are the point of this exercise.

If anyone gets this running, please report back. I hope to get back and try this myself again after knocking down a few more pressing priorities.
 
  • Love
Reactions: LMZ

LMZ

Cadet
Joined
May 20, 2022
Messages
4
Good news! I got notice this morning that my Dockerfile changes were merged, alongside the release of Urbackup 2.5.25.

(First up: @Tortar, I'm not sure offhand where the UI stores its settings. That might be what the author is doing with /usr/share/urbackup, so you might try adding a volume binding for that.)

Back to the Dockerfile: now it's easier (and more officially recognized) to build your own container with ZFS enabled.
Code:
git clone https://github.com/uroni/urbackup-server-docker.git
cd urbackup-server-docker
DOCKER_BUILDKIT=1 docker build --build-arg ZFS=1 --network=host --tag urbackup-server:2.5.25_zfs .
Again: if you build that way from within your TrueNAS SCALE command shell, its big blue button can find the locally built image as follows.
  • Image Repository: urbackup-server
  • Image Tag: 2.5.25_zfs
Unfortunately there's still not a ready-made official build in Docker Hub with that option. That might just be where things stand for a while.

As to adding --device /dev/zfs that might not be necessary. Using the big blue button you should be able to mimic the same effect by mapping /dev/zfs as-is from host to container and enabling privileged mode. Or — hopefully — you can leave off privileged mode and explicitly zfs allow … a reduced set of privileges specific to the account and dataset.

And the rest is a matter of server configuration. It reads to me as if file-based backups aren't very efficient unless you can enable ZFS deduplication. I hope that's not the case with image-based backups, which to me are the point of this exercise.

If anyone gets this running, please report back. I hope to get back and try this myself again after knocking down a few more pressing priorities.
What a Legend!
 

jct

Explorer
Joined
Aug 14, 2021
Messages
52
Hey! There we go, as of an hour ago. Better late than never: official builds with ZFS support in the container.

So nevermind building your own. Just use the uroni/urbackup-server:latest-zfs public Docker container.

@truecharts: might you take this from here, or will you need me to meet you on Discord with a bunch of annoying questions? :wink:
 

tiswi

Cadet
Joined
Nov 7, 2022
Messages
1
I keep having the "Dataset is not set via /etc/urbackup/dataset" error in the log, how can this be configured using the "launch docker" button in truenas scale?
2022-12-05 11:20:00.069610+00:00Testing for zfs...
2022-12-05 11:20:00.069620+00:00TEST FAILED: Dataset is not set via /etc/urbackup/dataset
 
Top