Ubu Server 7.10 Quota setup for groups

Discussion in 'Server Operation' started by normanp, Jan 22, 2008.

  1. normanp

    normanp New Member

    I have problems setting this up for a group. Am I right that a group quota applies its values to members of the group as individuals effectively?
    The following works for me for individuals:
    quotaoff -a
    (then in /etc/fstab)
    for / after 'defaults' add ',usrquota,grpquota'
    mount -o remount /
    touch /aquota.user /aquota.group
    chmod 600 /aquota.*
    edquota -u mike
    (set soft blocks 1000, hard blocks 1500)
    repquota /
    (to see if all OK - it is)
    quotaon -a

    The user quota now works fine and from a Vista machine it is enforced.

    Now for my problem: group quotas don't function when I do this:

    quotaoff -a
    edquota -u mike (to remove his quota limits (put back to 0))
    addgroup standardusers
    adduser mike standardusers
    edquota -g standardusers
    (set soft blocks 1000, hard blocks 1500)
    repquota /
    (to see if all OK - but standardusers not listed - why?)
    quotaon -a

    There is now no limit on mike - the group quota is not enforced!

    Further questions:
    Are the block quota values in kB?
    Why did I have to create aquota.user etc not quota.user? (quota did not enforce limits with quota.user)

    Thanks for all advice for this newb
  2. falko

    falko Super Moderator ISPConfig Developer

    Does mike belong to the group?

    This changes from distirbution to distribution. Some use the (old) quota.* format, some the newer aquota.* format.
  3. normanp

    normanp New Member

    Yes - mike belongs to that group.

    After a lot of thinking I have realised that quota simply keeps a tally of the total space occupied by files by user owner and group owner (true?).
    This means that if mike creates a file and is the owner it will be tallied against that user if a quota has been set for them. However the group owner of this file will also default to mike (unless I force group in samba setup or chgroup on a file) so it will not be tallied against say the group standardusers as I intended if I have set up quotas for that group.
    The consequence is that merely ensuring that users are members of a group and setting quotas on that group is not sufficient - files created by that user must take on that group membership as well to be tallied. This is no good really as this means that the group quota is a total of space taken up by those files across a set of users - not applied individually. This is also not practical as user owners could change the group owner of a file (I imagine).

    I have also found that repquota only reports for a group when there are files with that group owner - it will not report zero use (also true when using 'quota -g standardusers') and this made me think that group quotas were not functioning!

    So I would conclude that group quotas are not useful in this form and to apply the same quota across a set of users it is better to do something like this:
    edquota -p user1 'awk -F: '$3 > 499 {print$1}' /etc/passwd'
    to model users with ID of 500 and above on user1's previously set quota.
    (I got this off the web and wouldn't use it unitil I understand it).
    Seems like an ugly way to enforce the same quota across a set of users. If I delete a user the quota reference will still be there etc so poor for administration (I don't know how to get a quota removed from aquota.user - not just zeroed)

    It would be nice if the writers of quota could give an easy way of managing a group of users with the same quotas.

    BTW in The Perfect Server Ubuntu 7.10 it mentions quota.user and quota.group where actually aquota.user and aquota.group are needed (as 7.10 is using version 2 of quota).

    Also it would be great if the man page for quota explained the above properly. It is very confusing that repquota and quota don't list where use is zero.

    Finally I wonder if anyone has benchmarked quota - does it slow access significantly?
  4. falko

    falko Super Moderator ISPConfig Developer

    I haven't done a benchmark, but I haven't noticed any performance impacts yet. :)
  5. normanp

    normanp New Member

    Have I understood correctly above how quota functions?

Share This Page