Free Space calculation with ZFS



I’ve installed Urbackup on FreeNAS as described here: Howto: Install Urbackup on FreeNAS using ZFS

Despite of a backup Storage of about 7TB, and a free space of 6.7TB, every day my backups are deleted and the configured minimum number of file and image backups are kept.

I’ve done some debugging and for this I added some debuging in the os_functions_lin.cpp. See the following screenshot.

After that I’ve taken a screenshot of a cleanup action. See screenshot

The output of os_total_space function (variable total) is very strange. It shows 35098086866944 KByte which calculated are 35TB Storage.

In this screenshot you can see my ZFS structure.

Here are my mount points:
The /urbackup folder is placed on the / partition without a separate mount point.

This are a screenshot of the /urbackup folder

I think there are two main problems:

  1. The free space is calculated from /urbackup, which lies on ZFS-Dataset s01/j/ub01 (in the Jail volume). The calculation is correct with about 125GB free (see Screenshot of the cleanup action). But is logical wrong because, as shown in the ZFS screenshot, 6,7TB avaliable on the Backup volumes u01/u/01/f and u01/u/01/i.

  2. The total space calculation is wrong (35TB? - where this comes from? again look at the screenshot of the cleanup action).
    I think it has to be calculated for image and files in seperate tasks, because with ZFS it’s possible (and thats realy great!) to place files and image backups on different ZFS-Pools with a different size (different physical backup locations for image backups and files in one Urbackup instance).

How could this be solved?



Could you change:

fsblkcnt_t blocksize = buf.f_frsize ? buf.f_frsize : buf.f_bsize;


fsblkcnt_t blocksize = buf.f_bsize;

And check if that fixes 2. ?

W.r.t. 1) you should put the backup location into the same pool as the file/image datasets. Having those space managed separately isn’t supported.



I’ve now done the following:

  • Changed the “Backup storage path:” to u01/u/01/b, which is now on the same ZFS-Pool as the Image Dataset (u01/u/01/i) and File Dataset (u01/u/01/f).

Now the free space calculation is correct. The solution was to change the path as mentioned above.

Your suggestion to correct the source code from the previous post is not needed. I think the solution you provided for the source code is based on a misleading debug output in my first post! So i don’t changed to fsblkcnt_t blocksize = buf.f_bsize;.

But the total space problem remains.

Edit: Or total means the total space used!?!?? Not the total size of the volume?
1566206007967744 / 1024 (B) / 1024 (KB) / 1024 (MB) / 1024 (GB) / 1024 (TB) = 1,3910…

The output belongs to the following code.