5

I've run into the problem that my 5TB disk has a large proportion of content from one group of users, which is okay. I'd like to limit the total disk usage of that group to ~4.5TB, but I'm unable to, I get the following error:

setquota: Cannot set quota for group 100 from kernel on /dev/md1: Numerical result out of range

Google has not been very useful so far in trying to solve this question. Can anyone help or give direction?

JamesGuthrie
  • 121
  • 1
  • 6

3 Answers3

7

Okay, I've managed to get it figured out, so I'm going to answer my own question to the best of my knowledge.

The original error was caused by the fact that the quota format vfsv0 is unable to support quotas >= 4TiB. Quota has a (relatively) new format to support quotas >4TiB, called vfsv1. You need at least kernel 2.6.33 for kernel support for vfsv1.

You need(?) to use journaled quotas, which will work on ext4 and ext3(?).

In /etc/fstab you will need to add the following for quota support for your mount:

usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv1

an example fstab line would be (here, the mountpoint is /):

/dev/md1 / ext4 grpjquota=quota.group,usrjquota=quota.user,jqfmt=vfsv1 0 2

Don't create the files quota.user or quota.group in your mountpoint. Afterwards do:

mount -o remount /

then do

quotacheck -avugm

which will create quota.user and quota.group, followed by:

quotaon -avug

At this point, you may get an error along the lines of quotaon: Quota format not supported in kernel.

This is because the kernel wasn't compiled with support for vfsv1, but not to worry, try

modprobe quota_v1

modprobe quota_v2

quotaon -avug

if that worked, then be sure to add quota_v1 and quota_v2 to /etc/modules

If everything worked, then you should be able to change the quota to something over 4TiB!

JamesGuthrie
  • 121
  • 1
  • 6
  • Just adding a note: if you use webmin, you can follow these instructions manually and then the webmin interface appears to work for size > 4 TiB. – Dave May 03 '15 at 19:41
0

So thanks for your answers @JamesGuthrie and @Dom because they helped me for the beginning. However there was a part missing for the solution to work for me.
I was also trying to set quotas >4Tb on an ext4 filesystem.

You should use the argument -F vfsv1 when generating the quota files too with:
quotacheck -cugm -F vfsv1 /

0

In the man of setquota, I see :

-F, --format=quotaformat Perform setting for specified format (ie. don't perform format autodetection). Possible format names are: vfsold Original quota format with 16-bit UIDs / GIDs, vfsv0 Quota format with 32-bit UIDs / GIDs, 64-bit space usage, 32-bit inode usage and limits, vfsv1 Quota format with 64-bit quota limits and usage, rpc (quota over NFS), xfs (quota on XFS filesystem)

This is maybe what you want... I didn't try.

Dom
  • 6,628
  • 1
  • 19
  • 24
  • I'm using ext4, for which support for vfsv1 is only available from 2.6.33, so I've upgraded my kernel to later than 2.6.33. In setquota I now have the same text as you for the -F option. I saw somewhere else that one ought to use convertquota to upgrade from vfsv0 to vfsv1, but my version of convertquota seems outdated and doesn't mention (or support) vfsv1. I also tried setquota with -F vfsv1, but that threw the same error as before. I'm a bit at a loss as to what to do. – JamesGuthrie Jan 09 '12 at 15:12