In this article we will show how to enable quota on TerraMaster systems.
the TerraMaster OS called TOS – actual version 4.1.07.2883 – has a very limited toolset – that clearly justifies the huge price difference compared to a similar Synology device.
This a 2 bay NAS, our client has two 5GB drives mirrored as RAID 1 using a btrfs file system in this case. He created 2 shares: the first one is called ‘Work’, and second called ‘Backup’ to use it as a Time Machine storage. On Synology devices you can adjust the quota via the web interface, but in case of Terra Master there’s no such option if you are using btrfs, but only for ext4 file system. This is a major problem, as by the time the space Time Machine consumes will constantly grow, and eat up space from ‘Work’ until the NAS runs out of space. We have to try setting quota via SSH. Let’s see!
open Terminal and SSH to the device. 10.10.0.2 is the IP address and ‘admin’ is the user as by default:
ssh email@example.com -p 9222
we need to switch to sudo in order to perform some serious kung fu:
…now enter password and hit Enter.
let’s check if quota is enabled:
btrfs qgroup show /mnt/md0
we get the following error:
ERROR: can’t perform the search – No such file or directory
ERROR: can’t list qgroups: No such file or directory
it’s because quota is not enabled by default. Let’s enable it:
btrfs quota enable /mnt/md0
the NAS will start working so wait a couple of minutes, enter:
btrfs subvolume list /mnt/md0
this will list the available shares
btrfs quota rescan /mnt/md0
let’s limit the usable space of Backup to 500 GB:
btrfs qgroup limit 500G /mnt/md0/BackUp
now let’s check if its’s working:
btrfs qgroup show -reF /mnt/md0/BackUp
we get the following output:
WARNING: Rescan is running, qgroup data may be incorrect
qgroupid rfer excl max_rfer max_excl
——– —- —- ——– ——–
0/259 155.84GiB 155.84GiB 500.00GiB none
…where 259 is the ID of the Backup, 500.00 GB is used and the max_rfer is the quota limit.
Now, it all looks good until we feel up the space.
What will happen is that our client will not be able to delete anything in order to free up space.
You might look on forums and find tips like trying the following command:
cat /dev/null “path to an existing file that can be deleted”
…but it’s not working on TerraMaster.
Unfortunately there’s no other workaround than to SSH into the device again, lift the quota, delete some file, and reduce the quota back to previous value.
The other issue we found is that the available space that the Finder of macOS shows is the same value after turning on the quota as before – thus the user has no idea how much free space there actually is. It makes no difference if the user is connected via AFP or SMB. The same is with Windows, so it’s not a client but a NAS side problem.
Owners of NAS devices with quota enabled repeatedly get the following error message: ‘To improve reliability, Time Machine must create a new backup for you.’. The culprit of this problem is that the sparseimage file inside what Time Machine stores your backup gets damaged due to running out of space, plus the inability to free up space when it hapends.
What the solution is for Time Machine backups on NAS volumes is to dedicate a separate drive for it without quota enabled.
As a final conclusion: it’s not a coincidence administering quota is not available over the GUI of Terra Master for btrfs file system.
Our advice: if you need quota, stick to ext4.