Solution for Xfs_quota: Cannot Set Limits Error in DirectAdmin

AiroServer's Blog

Solution for Xfs_quota: Cannot Set Limits Error in DirectAdmin

Sometimes, when creating a user in DirectAdmin or restoring a backup, you might encounter the error “xfs_quota: cannot set limits: Function not implemented.”

This error indicates that DirectAdmin is trying to allocate space for an XFS filesystem. To resolve this issue, first, run the following command on your server to determine the filesystem type (XFS or EXT4) in use:

mount | grep ' /home '

In the above command, we checked the /home partition. You can check other partitions based on your needs. To view all server partitions, you can use the df -h command.

Xfs_quota Error in DirectAdmin

Checking Filesystem Type

If your server is using XFS, as shown in the image, please run df -h in the server SSH:

[root@ ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 14G 2.3G 12G 17% /
devtmpfs 915M 0 915M 0% /dev
tmpfs 921M 24K 921M 1% /dev/shm
tmpfs 921M 8.5M 912M 1% /run
tmpfs 921M 0 921M 0% /sys/fs/cgroup
/dev/sda1 497M 125M 372M 26% /boot

As you can see, the /home partition is not displayed in the list of partitions.

Run the mount | grep ' /home ' command again. If you see noquota in the output, follow the steps below.

Standardizing Partitioning

If you do not see noquota in the output, you need to standardize the partitioning on your server by adding uquota,pquota in the /etc/fstab file.

If noquota is seen in XFS, since noquota is the default kernel option for mounting the OS, it should be changed in the default kernel boot options. First, open the following file:

vi /etc/default/grub

Find the GRUB_CMDLINE_LINUX line in this file. This parameter will look similar to the image below (it may not be exactly the same, no worries!):

Xfs_quota Error in DirectAdmin

Add rootflags=uquota,pquota to the end of this parameter as shown below.

Xfs_quota Error in DirectAdmin

Applying the Changes

Based on the settings made, a backup is needed. Enter the following commands to create a new grub.cfg file (this address is different in some operating systems):

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

Finally, you need to reboot the server once for the changes to be recognized by the OS kernel:

reboot

DirectAdmin

Verifying the Changes

To ensure that the changes have been made correctly, run the mount | grep ' /home ' command again to verify that usrquota,prjquota or uquota,pquota is in the output. If so, the settings have been correctly applied.

Run the following command to ensure that DirectAdmin is using XFS:

cd /usr/local/directadmin
./directadmin c | grep use_xfs_quota

If you have previously created users in DirectAdmin, run the following command to ensure they are also using XFS:

 

echo "action=rewrite&value=quota" >> /usr/local/directadmin/data/task.queue

Handling EXT4 Filesystem

If your server is using EXT4, instruct DirectAdmin not to use XFS. Open the following file:

 

vi /usr/local/directadmin/conf/directadmin.conf

And add the following line:

 

use_xfs_quota=0

Then, run the following command to restart the DirectAdmin service and recognize the changes:

 

service directadmin restart

You can still read this article for more information about DirectAdmin features here.

Find More Articles...

Whats New?

en_USEN