Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

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!

share|improve this answer
add comment

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.

share|improve this answer
    
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 9 '12 at 15:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.