Bobcares

Enable quotas on servers using the XFS filesystem | How to guide

by | Nov 29, 2021

Enable quotas on servers using the XFS filesystem like a pro with guidance from our in-house experts. 

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 quotas on servers using the XFS filesystem.

How to enable quotas on servers using the XFS filesystem

We can enable quotas on the server using XFS via WHM: Initial Quota Setup Feature. This feature runs the intiquotas script.

Furthermore, we have to reboot the server after the process for the quotas to be functional.

  1. First. We will log in as the root to the server via SSH or the Terminal feature on WHM.
  2. Next, we will verify the filesystems are mounted using XFS with this command:
    # grep xfs /etc/fstab
    /dev/mapper/centos_whm1-root / xfs defaults,uquota 0 0
    UUID=fe712bf1-6f9f-4f69-950f-add2a660dfd4 /boot xfs defaults 0 0
    /dev/mapper/centos_whm1-home /home xfs defaults 0 0

    We will be able to see the currently enables filesystems as demonstrated here with the mount option uquota:

    # mount | grep xfs | grep -v virtfs
    /dev/mapper/centos_whm1-root on / type xfs (rw,relatime,attr2,inode64,uquota)
    /dev/sda2 on /boot type xfs (rw,relatime,attr2,inode64,noquota)
    /dev/mapper/centos_whm1-home on /home type xfs (rw,relatime,attr2,inode64,uquota)
    /dev/mapper/centos_whm1-root on /var/tmp type xfs (rw,relatime,attr2,inode64,uquota)

    Our Support Engineers would like to point out that we have to ensure the mount option for each quota for each specific mounted partition is enabled.

  3. After that, we have to log in to the WHM interface and then head to Initial Quota Setup under Server Configuration.
  4. Then, we will click Proceed as seen below:

    Enable quotas on servers using the XFS filesystem: Initial quota setup

  5. Next, we may have to wait a couple of minutes, depending on the size of the filesystems. After it is complete, we will see a screen as seen below:

    Enable quotas on servers using the XFS filesystem: Initial quota setup

  6. After that, we will reboot the server via the WHM interface by navigating to Graceful Server Reboot under the System Reboot section.

If you prefer to get this done manually, our Support Engineers recommend skipping steps 3,4,5 and 6 and running the following commands as root:

/scripts/initquotas
/scripts/fixquotas
reboot

In case the above-listed strategies do not help you out, it is time to check and modify the GRUB settings on the server.

We have to head to the /etc/sysconfig/grub file and ensure that the line starting with GRUB_CMDLINE_LINUX=, ends with

rootflags=uquota

After that, we have to make a backup of the /boot/grub2/grub.cfg file by running this command:

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

Then, we will rebuild /boot/grub2/grub.cfg file with this command:

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

Finally, we will reboot the server.

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

Conclusion

To conclude, the skilled Support Engineers at Bobcares demonstrated how to enable quotas on servers using the XFS filesystem.

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.