Category: Enabling Quotas in CentOS7

Share this post...Tweet about this on TwitterShare on Google+0Share on Facebook0

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 to get the full InterWorx experience. Follow these steps from the command line to enable quotas:

Enabling quotas requires restarting the server, which will cause downtime on production systems. If you plan to use quotas, it is recommended to enable them BEFORE installing InterWorx.

First, check if quotas are enabled:

mount | grep ' / '

You should see ‘noquota’ if quotas are disabled, for example:

# /dev/mapper/centos_el7-root on / type xfs (rw,relatime,attr2,inode64,noquota)

Next, edit /etc/default/grub:

vi /etc/default/grub

Find the line beginning with GRUB_CMDLINE_LINUX and append the following:

The line should end up looking something like this:

GRUB_CMDLINE_LINUX=" vconsole.font=latarcyrheb-sun16 crashkernel=auto  vconsole.keymap=us rhgb quiet rootflags=usrquota,grpquota"

Backup the grub configuration:

cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig
For servers using EFI, the grub.cfg file is listed here: /boot/efi/EFI/centos/grub.cfg

Generate the new grub configuration:

grub2-mkconfig -o /boot/grub2/grub.cfg

For EFI, use this command:  grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg



Verify success:

mount | grep ' / '

You should see quotas are now enabled:

/dev/mapper/centos_el7-root on / type xfs (rw,relatime,attr2,inode64,usrquota,grpquota)
Dec 30, 2014, 12:57 pmBy: InterWorx
Enabling Quotas in CentOS7
65 votes, 2.14 avg. rating (42% score)
(4) Comments
  1. jhosep: Muchas gracias, me solucionó el problema.
    June 11, 2019 at 12:49 pm
  2. desdery kasimbazi: thanks a lot the problem is solved
    January 21, 2019 at 6:03 am
  3. Oscar Pouwels: Still if you use a separate partition for /chroot with quota enabled do you need to set quota for the / partition as well? Does not seem to work without it.
    July 28, 2017 at 9:56 am
  4. umer sharif: Thanks for the guide. Helped me a lot to configure quota on my PS
    April 23, 2016 at 9:07 am

Leave a Reply
Surround code blocks with <pre>code</pre>

Your email address will not be published.


Broken Link