Note

You are viewing the documentation for an older release of Interworx (6.x). To see documentation for the current generally available release of Interworx, click here: 7.13.

How to: Enable Quotas in CentOS 7

Warning

Enabling quotas requires restarting the server, which will cause downtime on production systems. Because of this, it is recommended to enable quotas before installing InterWorx.

The release of EL7 marks the shift from Ext4 to XFS as the default filesystem for RHEL-based distros like CentOS. While XFS brings many improvements and features to the OS, user and group quotas are no longer enabled by default on the root (‘/’) partition.

While quotas are an optional feature, they are recommended for the full InterWorx experience.

Note

Quotas should be enabled on the partition where the /home directory is located. If /home is located under root (‘/’) , then quotas should be enabled on root (‘/’) . If there is a separate /home parition, then quotas should be enabled on /home, instead.

To Enable Quotas

  1. Log in to the server at the command line as root, either via SSH or from the terminal

  2. Check if quotas are already enabled

    mount | grep ' / '
    
    • If quotas are disabled, the output will state ‘noquota’

    /dev/mapper/centos_el7-root on / type xfs (rw,relatime,attr2,inode64,noquota)
    
    • If quotas are already enabled, the output will show ‘usrquota’ and ‘groupquota’

    /dev/mapper/centos_el7-root on / type xfs (rw,relatime,attr2,inode64,usrquota,grpquota)
    
  3. In a text editor, open /etc/default/grub

  4. Append rootflags=usrquota,grpquota to the line beginning with GRUB_CMDLINE_LINUX

    GRUB_CMDLINE_LINUX="rd.lvm.lv=centos_el7/root vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_el7/swap crashkernel=auto vconsole.keymap=us rhgb quiet rootflags=usrquota,grpquota"
    
  5. Backup the grub configuration:

    cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig
    
    • For servers using EFI, the grub.cfg file is located at /boot/efi/EFI/centos/grub.cfg

      cp /boot/efi/EFI/centos/grub.cfg /boot/efi/EFI/centos/grub.cfg.orig
      
  6. Generate the new grub configuration

    grub2-mkconfig -o /boot/grub2/grub.cfg
    
    • For servers using EFI:

      grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
      
  7. Reboot the server

  8. Verify that quotas have been enabled

    mount | grep ' / '