Correct way to set a per user quota for multi user time machine share?

I have two internal CORE systems that serve as time machine targets for all my colleagues. They have been in use for a couple of years without any incident and it seems that just about now the first users hit their assigned storage space limit.

I used these settings:

The system itself is connected to our Active Directory for authentication. As you can see from the auxiliary parameters I used the fruit:time machine max size parameter combined with auto creation to set the space limit.

Each user automatically gets their own dataset. Snapshots after time machine completion etc. work well.

But when the 1 TB limit is reached, time machine on the Mac in question does not delete old backups but instead just complains about a lack of space and refuses to perform another run.

So what can I do about this? Setting ZFS quota won’t be available when the datasets are created automatically, right? That’s why I picked that auxliiary parameter.

Any fix greatly appreciated. An upgrade to CE would be possible provided that multi user time machine with AD authentication works in CE. Does it?

Thanks and kind regards,
Patrick

@awalkerix any idea?

That’s client-side handling. You might be able to insert a plist file into the time machine share, or use tmutil on the mac to set one.

I guess I’ll try to create a cron job that simply sets a ZFS quota for all datasets below <pool>/share/tm - that’s trivial. And a new colleague will not fill their 1 TB on the first day before the cron job runs.

What do you think?

IIRC in core I have some logic to auto-set a ZFS quota, but that would run into same problems as builtin option. If MacOS isn’t properly handling low-space on disk then adding a ZFS quota won’t work.

I hope a hard ZFS limit will be more robust than the Samba option? The former was how I ran TM at home when I still did that. That was only a single dataset so that part was easy. Never had a problem.

For one colleague backups somehow caught up and the error message has not reappeared, since. Macs. Weird.

So to force a ZFS quota on all direct children of a specific parent dataset:

#!/bin/sh

TMDATASET="fusion/share/tm"
TMQUOTA="1T"

ZFS="/usr/local/sbin/zfs"
AWK="/usr/bin/awk"
SH="/bin/sh"

${ZFS} list -r ${TMDATASET} | ${AWK} "{ if (match(\$1, \"^${TMDATASET}/\")) printf \"zfs set quota=${TMQUOTA} %s\n\", \$1 }" | ${SH}

When I have tried to set a quota from the TrueNAS side, it always ran into trouble, but I likely also did things wrong.

The most reliable way I have found was setting a quota in MacOS when I created the TM backup job.

1 Like