re-configure quota management

Discussion in 'Server Operation' started by misterm, Mar 11, 2016.

  1. misterm

    misterm Member HowtoForge Supporter

    Hello
    silly question, but when we set up the first time the quota management on a server, and when we add a disk, you can redo the manupulation a second time, or what is lost?

    If possible, how?

    Thank you

    Mz
     
  2. ztk.me

    ztk.me Active Member

    Did you mount the new disk using quota options like in the tutorial?
    You can recalculate your quotas easily
    Code:
    #First turn off quota
    quotaoff -ug /
    
    #Then backup and reset the quota database
    mv /aquota.user /aquota.user.bck
    mv /aquota.group /aquota.group.bck
    
    #Then run quotacheck to get the quota back in sync
    quotacheck / -vugm
    
    #Finally turn back on quota
    quotaon -ug /
    
     
    misterm likes this.
  3. misterm

    misterm Member HowtoForge Supporter

    Hello, Thanks for your response
    This is not to replace
    I add a drive, I would mount the / var on that disk and then reconfigure quota management.
    It's your quota have several managements, or is that done only on a hard drive?
    Thank you
    Mz ;)
     
  4. ztk.me

    ztk.me Active Member

    You need seperate quotafiles for your /var mount point,
    just use /var instead of / in the above codes.
     
    misterm likes this.
  5. misterm

    misterm Member HowtoForge Supporter

    Several quota management on a server that is not possible?
    I translate my sentences, I do not speak a word of English, I understand, more or less, but here, I know, big default on my part
     
    Last edited: Mar 11, 2016
  6. ztk.me

    ztk.me Active Member

    oui c'est possible :) No je ne parle pas le francaise :(
    You can/need to add additional quota for your /var mount
    You need to mount /var with quota options like the / mount point and set them up the same way, just use /var instead of / this time.
     
    misterm likes this.
  7. misterm

    misterm Member HowtoForge Supporter

    a tutorial that I understand better what I mean
    Thank you

    Mz
     
  8. ztk.me

    ztk.me Active Member

    Just pick any matching "Perfect Server" Howto and go to the "Install Quota" section and redo the steps for your new disk.

    En example Debian 8

    nano /etc/fstab
    Code:
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    # / was on /dev/sda1 during installation
    UUID=3dc3b58d-97e5-497b-8254-a913fdfc5408 / ext4 errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0 1
    
    UUID=34fd247g-56a2-493b-8347-3f3267f2s46h /var ext4 errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0 1
    # swap was on /dev/sda5 during installation
    UUID=36bf486e-8f76-492d-89af-5a8eb3ce8a02 none swap sw 0 0
    
    

    Code:
    mount -o remount /var
    quotacheck -avugm
    quotaon -avug
    
     
    misterm likes this.
  9. misterm

    misterm Member HowtoForge Supporter

    Hello
    Thank you for the tutorial and especially for your help
    How get the UUID of a disk, as in this case.
    Thank you
    Mz ;)
     
    ztk.me likes this.
  10. ztk.me

    ztk.me Active Member

    UUID of specific disk:
    blkid /dev/sdaX

    All disks:
    blkid

    Or just
    ls -Al /dev/disk/by-uuid
     
    misterm likes this.
  11. misterm

    misterm Member HowtoForge Supporter

    Big thank you again for your help
    Mz
     
    ztk.me likes this.
  12. misterm

    misterm Member HowtoForge Supporter

    Then I run the above command:
    Then this command, the error
    Note that I've added the line in my stab file
    MZ
     
  13. ztk.me

    ztk.me Active Member

    quotacheck -avugm does recalculate all quotas. In this case quotas is already activated for / so you can't redo it.
    Just run
    Code:
    quotacheck /var -vugm

    If you want to recalculate all quotas:
    Code:
    #First turn off quota
    quotaoff -ug /
    quotaoff -ug /var
    
    #Then backup and reset the quota database
    mv /aquota.user /aquota.user.bck
    mv /aquota.group /aquota.group.bck
    mv /var/aquota.user /var/aquota.user.bck
    mv /var/aquota.group /var/aquota.group.bck
    
    #Then run quotacheck to get the quota back in sync
    quotacheck / -vugm
    quotacheck /var -vugm
    
    #Finally turn back on quota
    quotaon -ug /
    quotaon -ug /var
    
     
  14. misterm

    misterm Member HowtoForge Supporter

    Thank you, but I do not make quota on the disk.
    Because you put me commands to disable and re-enable the Quota.
    I will not say I do not understand.
    Applying these commands:
    Logically it should go?
    Yours
    Mz
     
  15. ztk.me

    ztk.me Active Member

    Yes :) You currently just need to calculate and enable quota for /var
     

Share This Page