For cPanel or Webuzo Servers
Enabling disk quotas on XFS requires configuring the kernel boot parameters, modifying /etc/fstab
, and rebuilding GRUB. This guide walks you through the entire process for AlmaLinux 9 / CloudLinux 9, commonly used in hosting environments like cPanel or Webuzo.
โ Step 1: Check If XFS Quotas Are Enabled
Run the following to check current mount options:
mount | grep xfs
Example output if quotas are not enabled:
/dev/sda2 on / type xfs (rw,relatime,attr2,inode64,noquota)
Also confirm using:
xfs_quota -x -c state
If you get no output, quotas are not enabled.
โ
Step 2: Update /etc/fstab
Ensure the root partition has the usrquota
option set:
UUID=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / xfs defaults,usrquota 0 0
Replace the UUID with the correct one for your root partition. You can get UUIDs with:
blkid
โ Step 3: Edit GRUB to Enable Quotas at Boot
Edit the GRUB config file (location may vary):
For AlmaLinux or CloudLinux:
nano /etc/default/grub
Append rootflags=uquota
to the GRUB_CMDLINE_LINUX
line:
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet rootflags=uquota"
โ Step 4: Backup and Rebuild GRUB Config
Backup Existing GRUB File
Run the appropriate command for your system:
# For BIOS systems
cp -ax /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig-$(date +%s)
# For UEFI (AlmaLinux)
cp -ax /boot/efi/EFI/almalinux/grub.cfg /boot/efi/EFI/almalinux/grub.cfg.$(date +%s)
# For CloudLinux (similar path)
cp -ax /boot/efi/EFI/cloudlinux/grub.cfg /boot/efi/EFI/cloudlinux/grub.cfg.$(date +%s)
Rebuild the GRUB Config
# For BIOS
grub2-mkconfig -o /boot/grub2/grub.cfg
# For UEFI (AlmaLinux)
grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg
๐ Optional Fix: Use grubby
If GRUB Edit Doesnโt Work
If youโre on AlmaLinux 9 or CloudLinux 9, and the above steps did not work, use:
grubby --args="rootflags=uquota" --update-kernel=ALL
Then reboot the system.
๐ Step 5: Reboot the Server
reboot
After reboot, confirm quotas are enabled:
mount | grep xfs
xfs_quota -x -c state
๐ Recalculate Quota for Webuzo (Optional)
If you’re using Webuzo, run the following after enabling quotas:
/usr/local/emps/bin/php /usr/local/webuzo/cronh.php debug=4
webuzo --reapply_plan --all
๐ Webuzo Docs โ How to Recalculate Quota
โ Final Notes
- Make sure your root partition is formatted as XFS (required).
- For cPanel, once quotas are enabled and server is rebooted, use WHM โ Initial Quota Setup to complete.
- For Webuzo, use the reapply plan command above to sync limits.