Enable XFS Quotas

Enable XFS Quotas

  • First check the quotas are not enabled by command.
[root@demo ~]# mount | grep xfs
/dev/sda2 on / type xfs (rw,relatime,attr2,inode64,noquota)

  • Also check with command "xfs_quota -x -c state" it will give empty result means that quota is disabled.

  • Check in /etc/fstab that user quota entry is present. 

UUID=df5462ce-cd8a-417d-a454-7688139cf2228 / xfs defaults,usrquota 0 0

XFS needs to be configured with kernel options during boot up. Perform the following steps.

  • For Almalinux : /etc/sysconfig/grub
  • For Centos: /boot/efi/EFI/centos/grub.cfg
  • For Ubuntu: /etc/default/grub

  • Append the "rootflags=uquota" in "GRUB_CMDLINE_LINUX=" line 
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet rootflags=uquota"

  • Make a copy of the grub configuration file.
# For "/boot/grub2/grub.cfg"
cp -ax /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig-$(date +%s)

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

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

# For Ubuntu :
cp -ax /etc/default/grub /etc/default/grub.$(date +%s)

  • Rebuild the grub configuration file by executing following command.
# For "/boot/grub2/grub.cfg"
grub2-mkconfig -o /boot/grub2/grub.cfg

# For Centos :
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

# For Almalinux :
grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg

# For Ubuntu :
grub-mkconfig -o /etc/default/grub

  • Reboot the server.


If your OS is almalinux 9 and the above solution did not work, then execute the below command as root and reboot the server:

grubby --args="rootflags=uquota" --update-kernel=ALL
Was this page helpful?