Quota problem

Discussion in 'ISPConfig 3 Priority Support' started by diablo666, Mar 14, 2019.

  1. diablo666

    diablo666 Active Member HowtoForge Supporter

    I've some problems with quota...
    For example on client web65 with du command i'll get
    Code:
    1,2G    /var/www/clients/client29/web65
    on the panel i only see 41.22 MB
    My /etc/fstab looks like
    Code:
    UUID=d7bbdca4-5ce9-4467-9b99-d7d90ce863ce /               ext4    errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0       1
    and
    Code:
    /var/log/ispconfig/httpd/domain.tld /var/www/clients/client29/web65/log    none    bind,nobootwait    0 0
    with quota tool i'll get
    Code:
    Disk quotas for user web65 (uid 5064):
         Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
          /dev/sda1   42268  2048000 2049024            6886       0       0
    
    What's wrong?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The du command counts the size of files in a specific directory. Linux filesystem quota counts and limits the size of files owned by a specific user or group. If du and quota differ, then you probably uploaded files under a different user than the web user to the web directory. Another reason can be that the Linux quota system is not working correctly, but this does not happen quite often.
     
  3. diablo666

    diablo666 Active Member HowtoForge Supporter

    May be if for example a user uses modphp so the user who upload the files is www-data instead of the webxx user?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, that might be. mod_php mode exists only for legacy reasons and should not be used for years now. If you still use mod_php in websites, switch them to php-fpm and ensure that suexec is alawys turned on.
     
  5. diablo666

    diablo666 Active Member HowtoForge Supporter

    It seems not working... also the count of numbers of files differs from reality... any idea what could i check?
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What is not working?
    How can this be? How do you determine the count of files and how do you determine what is reality?
    See what files belong to the user web65 in that web directory:
    Code:
    find /var/www/clients/client29/web65 -user web65 -exec ls -lh {} \;
    Then compare that to ls -lh /var/www/clients/client29/web65, does that have lots of extra files?
    Actually I just came up with a better command, this should find all files in that directory tree that do not belong to the website owner:
    Code:
    find /var/www/clients/client29/web65 -not -user web65 -exec ls -lh {} \;
     
    Last edited: Mar 17, 2019
  7. diablo666

    diablo666 Active Member HowtoForge Supporter

    The quota differs from the real site occupation...
     
  8. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Like @till explained, they measure different things. Quota measures files owned by a user, du counts sizes of files in a subdirectory tree. They are not necessarily the same. Only way they could be same is if a directory tree contains only files belonging to the same user, and that user has no files anywhere outside that directory tree.
     
  9. diablo666

    diablo666 Active Member HowtoForge Supporter

    Sure I've changed it. All files belong only to one user...
     
  10. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I do not believe this. Show the results of the latter command I put in CODE tags in #6.
     
  11. diablo666

    diablo666 Active Member HowtoForge Supporter

    I've done a chown -R, so yes I'm sure what I'm talking about :p
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Either files are ownedd by a wrong user or group (not the web user and client group of that site) or the partition where the website resides on has no quota enabled or the quota system of your server is broken. You can try to force quota to recalculate file usage with:

    Code:
    quotaoff -avug
    quotacheck -avufgm
    quotaon -avug
    systemctl enable quota
    systemctl daemon-reload
    service quota start 
     
  13. diablo666

    diablo666 Active Member HowtoForge Supporter

    Ok... this seems to had fixed the problem, now all is matching correctly :D

     

Share This Page