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.
- Modify file "/etc/sysconfig/grub" or "/boot/efi/EFI/centos/grub.cfg"(On EFI enabled system)
- 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)
OR
# For "/boot/efi/EFI/centos/grub.cfg"
cp -ax /boot/efi/EFI/centos/grub.cfg /boot/efi/EFI/centos/grub.cfg.$(date +%s)
OR
# For "/boot/efi/EFI/almalinux/grub.cfg"
cp -ax /boot/efi/EFI/almalinux/grub.cfg /boot/efi/EFI/almalinux/grub.cfg.$(date +%s)
- Rebuild the grub configuration file by executing following command.
# For "/boot/grub2/grub.cfg"
grub2-mkconfig -o /boot/grub2/grub.cfg
OR
# For "/boot/efi/EFI/centos/grub.cfg"
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
OR
# For "/boot/efi/EFI/almalinux/grub.cfg"
grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg
- Reboot the server.
NOTE:
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