Can not assign quota to share

Brief description of the problem

When trying to change the quota from a share (on a hard drive pool that is not the ROOT pool) from the share size to something else, I get the error. I believe when I initially created the share I had assigned a quota to it, but at that time quota were not working. And now I can’t resize that quota?

Error Traceback provided on the Web-UI

            Traceback (most recent call last):
  File "/opt/rockstor/src/rockstor/rest_framework_custom/", line 41, in _handle_exception
  File "/opt/rockstor/src/rockstor/storageadmin/views/", line 247, in put
    share_pqgroup_assign(share.pqgroup, share)
  File "/opt/rockstor/src/rockstor/fs/", line 1335, in share_pqgroup_assign
    return qgroup_assign(share.qgroup, pqgroup, share.pool.mnt_pt)
  File "/opt/rockstor/src/rockstor/fs/", line 1404, in qgroup_assign
    raise e
CommandException: Error running a command. cmd = /usr/sbin/btrfs qgroup assign 0/258 2015/43 /mnt2/Main. rc = 1. stdout = ['']. stderr = ['ERROR: unable to assign quota group: File exists', '']

More info

The share is mounted to the nextcloud rockon, and nextcloud reports a volume size of 3.5TB, which sounds about accurate for what I had initially set the quota as. However, according to the rockstor UI there are only about 900GB of data on the share (with a share quota of 9.1 TB; the entire pool), so the nextcloud share free space calculation must be off, too. If I run df via SSH, it agrees that the share has 3.5TB used and is 100% full. It also agrees, though, that the share size is 9.1TB. I believe the listing shows the state of the entire pool, which it somehow seems to think is 100% full, even though only about 30% are used. But that’s only a secondary and tertiary issue, uncovered by the first.

@freaktechnik Hello again.

Unfortunately the quota system within btrfs and more so within Rockstor is currently very much ‘in development’ and as such, on the Rockstor side, we simply don’t inforce it at all. Hence our warning banner on the Shares overview page and every share details page:

We manage the quote groups, although the requirement for some of this is also changing in upstream btrfs (ie default 0/* goups are now auto deleted on subvol delete but they use to have to be managed and we still try to do this)

So given we have some issues on our quota group management, ie changing sands, and our own need to do a little more work in this area, it is not uncommon to run into some quota related issues. But given they are currently, as indicated, not actually doing anything, it’s mostly cosmetic.

So keep in mind that quota and size are not currently tied. We intend to tie these together once the quota system has matured a little. And for this we need to complete our move to an openSUSE base to get those upstream improvements. But yes, we definitely have some ‘holes’ in our quota group management and you look to have run into one. You could try turning quotas for that pool off and then on again. But keep in mind that it can take in the order of serveral minutes per TB to re-establish quotas. During this time Rockstor will try again to get it’s quota groups back in order. But there are known limitations to the way we currently do this.

This is another wrinkle. Many commonly know disk space measures such as ‘df’ are simply unaware of who a COW / snapshot capable filesystem storage works so they are just wrong in many cases. The tool you need is btrfs’s own usage command:

btrfs filesystem usage /mnt2/pool-name-here

That should help to see more what’s taking up what space.

Not sure which listing you are referencing here but the tool may be confusing allocated with used, i.e. see the output of the above command. Area on disk is first allocated into btrfs raid managed chunks which may or may not be wholly or partially used.

Hope that helps. And yes we are due to do more work on our side of quota management and it would be nice to start enabling the share sizes via their respective quotas. But currently the share size is pretty much just a Web-UI indicator.

1 Like