Friday, October 19, 2018

How to Set Quota on CLoudLinux 7.5 kvm Image With XFS

I just installed CloudLinux 7.5 kvm images, downloaded from CloudLinux website, then failed to update Quota on the WHM. They already set it with XFS file system.
Updating Quota Files......
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.

Then I did this.

Check /etc/fstab makes sure that the quota is enabled on the partition
UUID=xxx-xxx / xfs     defaults,uquota 0 0
Check the quota option for XFS filesystem.

# mount| grep ' / '
You will see something like this.
/dev/sda1 on / type xfs (rw,relatime,attr2,inode64,noquota)
If you see the "noquota" option, then you need to go to next step.

Edit /etc/default/grub add rootflags=uquota
GRUB_CMDLINE_LINUX="crashkernel=auto biosdevname=0 net.ifnames=0 rhgb quiet rootflags=uquota"
Reconfig grub
# grub2-mkconfig -o /boot/grub2/grub.cfg
# reboot
After the server started.
# mount| grep ' / '
Then the XFS will change like this.
/dev/sda1 on / type xfs (rw,relatime,attr2,inode64,usrquota)
Fix WHM quota
# /scripts/fixquotas
# reboot