CentOSHow ToLinuxPleskUbuntu

CentOS/Plesk How To: Enable Disk Quotas on xfs filesystems

"Hard disk quota is not supported due to the configuration of the server file system."

If you’ve bumped into the “Hard disk quota is not supported due to the configuration of the server file system.” error in Plesk, or just need to enable hard disk quotas this guide is for you! This guide is tested on CentOS 8 with Plesk installed, but only the last step includes Plesk specific commands so should work for anybody on the same OS.

Install Quota

First install the quota utility if it isn’t already:

sudo yum install quota

Back up Files

You’ll need to back up the files we’re editing today just in case you need to restore them in recovery mode. We’ve not had any problems on either of the servers we did this on, but be very careful.

sudo cp /etc/default/grub /etc/default/grub_backup
sudo cp /etc/fstab /etc/fstab_backup
sudo cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg_backup

Edit /etc/default/grub

Open /etc/default/grub and add rootflags=usrquota,grpquota into the GRUB_CMDLINE_LINUX line like so:

sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX="crashkernel=auto resume=/dev/mapper/centos-swap rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rootflags=usrquota,grpquota"

Then generate your new GRUB boot config file with:

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

Edit /etc/fstab

Next we’ll need to make sure the line in /etc/fstab pertaining to root (/) and sometimes /var if that’s mounted separately contains defaults,uquota,gquota.

sudo nano /etc/fstab
# /etc/fstab
# Created by anaconda on Fri Sep 27 10:58:14 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/centos-root / xfs defaults,uquota,gquota 0 0

Reboot + Inform Plesk

Reboot for the changes we’ve made to take effect, and then inform Plesk of the changes we’ve made.

sudo reboot
plesk sbin packagemng -sdf

Check it’s enabled

Plesk users can run the command below, and if you get a result of 0, it worked!

/usr/local/psa/admin/sbin/usermng --isquotable

CentOS users who aren’t using Plesk can check with the command below. If it returns a list of user quota usage, it worked.

repquota -as

Related Articles

Back to top button
Close