Bobcares

Enabling XFS quotas | All about

by | Nov 29, 2021

Enabling XFS quotas like a pro with this handy guide from Bobcares.

At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.

Let’s take a look at how our Support Team recently helped a customer enable XFS quotas without any trouble.

All about Enabling XFS quotas

If you are looking for a way to enable XFS quotas on a CentOS 7 server, you are in luck. Our Support Engineers offer you an easy solution.

First, we have to confirm that the XFS quotas are already enabled. For instance, in this example, we can see nooquota:

[15:01:32 cp1 root@93969605 /etc]cPs# mount |grep xfs
/dev/vda1 on / type xfs (rw,relatime,attr2,inode64,noquota)
[15:01:34 cp1 root@93969605 etc]cPs#

Another way to check whether XFS quotas are enabled or not is to run the following command:

xfs_quota -x -c state

If it returns no results, it clearly indicates that XFS quotas have not been enabled.

After that, we have to check if the file setting in/etc/fstab is enabled or not.

[15:01:36 cp1 root/etc]cPs# grep xfs /etc/fstab
UUID=de86ba8a-914b-4104-9fd8-f9de800452ea / xfs defaults,uquota 0 0
[15:02:09 cp1 root/etc]cPs#

According to our Support Techs, XFS has to be configured with kernel options at boot up. We will do this by modifying /etc/sysconfig/grub.

If it is a EFI enabled system, we have to modify /boot/efi/EFI/centos/grub.cfg.

Here, we will replace the “GRUB_CMDLINE_LINUX=” with “rootflags=uquota”.
For instance,

GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200 earlyprintk=ttyS0,115200 consoleblank=0 crashkernel=no nosplash nomodeset rootflags=uquota"

After that, we will make a copy of the grub configuration files. In other words, a copy of
/boot/grub2/grub.cfg or /boot/efi/EFI/centos/grub.cfg.

cp -ax /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig-$(date +%s)

cp -ax /boot/efi/EFI/centos/grub.cfg /boot/efi/EFI/centos/grub.cfg.$(date +%s)

cp -ax /boot/efi/EFI/almalinux/grub.cfg /boot/efi/EFI/almalinux/grub.cfg.$(date +%s)

Finally, we need to rebuild the grub configuration file utilized during the server boot procedure.

In case /boot/grub2/grub.cfg exists:

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

In the scenario that /boot/efi/EFI/centos/grub.cfg exists, we will execute this command:

 grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

If /boot/efi/EFI/centos/grub.cfg exists, we will run the following command:

grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg

After this, we can reboot the server.

Once we are done with this process, the XFA quotas will be enabled. Furthermore, we can see the quotas set for cPanel users by running this command:

/usr/local/cpanel/scripts/resetquotas

[Need a hand? We are just a click away.]

Conclusion

To sum up, the skilled Support Engineers at Bobcares demonstrated how to check whether XFS quotas are enabled or not and how to enable them.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.