Home DirectAdmin Fix the error: xfs_quota: cannot set limits: Function not implemented Directadmin

Fix the error: xfs_quota: cannot set limits: Function not implemented Directadmin

by Thạch Phạm

Overview of error “xfs_quota: cannot set limits: Function not implemented DirectAdmin”

The error xfs_quota: cannot set limits: Function not implemented on DirectAdmin may appear when you adjust a user’s usage capacity or initialize the first user.

First, you need SSH into your VPS/Server. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:

The cause of this error is that the partition on your VPS/Server does not have a /home partition, you can see it using the df -h command. For example, my VPS below doesn’t have a /home partition:

FilesystemSizeUsedAvailUse%Mounted on
devtmpfs1.9G01.9G0%/dev
tmpfs1.9G24K1.9G1%/dev/shm
tmpfs1.9G17M1.9G1%/run
tmpfs1.9G01.9G0%/sys/fs/cgroup
/dev/mapper/centos_sv3-root28G4.3G24G16%/
/dev/sda11014M193M822M19%/boot
tmpfs379M0379M0%/run/user/0
xfs_quota: cannot set limits: Function not implemented Directadmin

Fix the error: xfs_quota: cannot set limits: Function not implemented Directadmin

Before handling the error, you need to check that your filesystem is in EXT4 or XFS format, you can use the following command to check:

AZDIGI Tutorial
mount | grep ' / '
    

After running this command, you will be able to determine which format you use.

Your VPS/Server will be in 1 of 2 cases below:

AZDIGI Tutorial
Trường hợp 1: /dev/sda3 on / type ext4 (rw,usrquota,grpquota)
Trường hợp 2: /dev/mapper/centos-root on / type xfs (rw,relatime,attr2,inode64,noquota)
    

Case 1 is your system using ext4 format and case 2 is xfs. Depending on each case, you choose the corresponding method.

If is EXT4:

In the case of ext4, the solution is quite simple, you just need to run the following 4 commands:

AZDIGI Tutorial
cd /usr/sbin
mv setquota setquota.old
touch setquota
chmod 755 setquota
    

So you have solved the “xfs_quota: cannot set limits: Function not implemented Directadmin” error for systems using EXT4 format.

For XFS system

For xfs system, it will be different from ext3/ext4. But first, you should double-check to be sure.

Step 1: Check the partition on Linux

We will recheck with the df -h command to see the current partitions:

FilesystemSizeUsedAvailUse%Mounted on
devtmpfs1.9G01.9G0%/dev
tmpfs1.9G24K1.9G1%/dev/shm
tmpfs1.9G17M1.9G1%/run
tmpfs1.9G01.9G0%/sys/fs/cgroup
/dev/mapper/centos_sv3-root28G4.3G24G16%/
/dev/sda11014M193M822M19%/boot
tmpfs379M0379M0%/run/user/0

As we can see /home is not a partition as it is not visible on this table. Because it’s on the inside /. Next we go to step 2.

Step 2: Confirm that / is indeed using the XFS file system

We use the following command again to determine if the / partition is using the xfs file format

AZDIGI Tutorial
mount | grep ' / '
    

We will have the result as below:

AZDIGI Tutorial
[root@sv3 ~]# mount | grep ' / '
/dev/mapper/centos_sv3-root on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
    
xfs_quota: cannot set limits: Function not implemented Directadmin

If you see the option “noquota”, you need to skip to step 3 below.

If you don’t see “noquota“, then you can follow these DirectAdmin instructions:

Step 3: Fix “xfs_quota: cannot set limits: Function not implemented Directadmin” error with xfs system

Since “noquota” is the default kernel mount option, we have to change it in the kernel boot options.

To change, we use the following command:

AZDIGI Tutorial
vi /etc/default/grub
    

You will see a few lines of kernel system configuration, maybe each system is different but doesn’t worry. Here is the file content on my VPS:

AZDIGI Tutorial
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos_sv3/root rd.lvm.lv=centos_sv3/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
    

More illustrations for you to imagine:

Here you find the line “GRUB_CMDLINE_LINUX“, as mine is line number 6.

AZDIGI Tutorial
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos_sv3/root rd.lvm.lv=centos_sv3/swap rhgb quiet"
    

Let’s start moving the “quote” to the end of this line, but don’t pass the double quote ().

Here, you press “i” to proceed to edit the line and add the text “rootflags=uquota,pquota“. Below is a before and after comparison when editing.

AZDIGI Tutorial
Trước: GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos_sv3/root rd.lvm.lv=centos_sv3/swap rhgb quiet"
Sau  : GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos_sv3/root rd.lvm.lv=centos_sv3/swap rhgb quiet rootflags=uquota,pquota"
    

More illustrations for you to imagine:

After changing, remember to save it. Then we continue with the following two commands:

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

Explanation of the above commands:

Command 1: Back up the file “grub.cfg” to a new file named “grub.cfg.orig“.
Command 2: Regenerate the grub configuration file.

For some other OS, the path may change to:

AZDIGI Tutorial
/boot/efi/EFI/centos/grub.cfg
    

Here are results of my VPS:

Next, restart your VPS or Server with the “reboot” command.

After logging back into your VPS/Server, check again with the old command to see if the “noquota” option is still available.

AZDIGI Tutorial
mount | grep ' / '
    

Below is results of my VPS:

The “noquota” option is no longer visible. Next, check if the option to use “xfs” is enabled in the DirectAdmin configuration, you can use the following two commands to check:

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

Explanation of the two commands above:

  • Command 1: Move to the location of the DirectAdmin configuration file
  • Command 2: Check which parameters Directadmin use_xfs_quota is configuring

The result as below, you can proceed to the last step.

AZDIGI Tutorial
use_xfs_quota=1
    

The last step is to restore the space usage quota for the users that have been initialized:

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

Check if the error “xfs_quota: cannot set limits: Function not implemented DirectAdmin” still exists.

To check, try changing the capacity size of a user and then click “Save“. After clicking Save, you will see that the error is no longer displayed and the saving process is complete.

So you have completed the steps to solve the “xfs_quota: cannot set limits: Function not implemented DirectAdmin” error.

Wishing you success.

Đánh giá

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign