Directadmin Error Quota & Enable Quota on xfs
Date: October 25, 2023
Categories: Directadmin, Linux
The XFS filesystem requires specific steps to enable quotas. This guide covers both standard quota setup and additional steps for / (root) partition, which uses XFS.
Step 1: Confirm Your Setup
# Check available partitions
df -h
If /home is not a separate partition, quotas must be set up on the root (/) partition.
Step 2: Confirm XFS Usage
# Check the filesystem type for the root partition
mount | grep ' / '
If “noquota” appears in the mount options, proceed with the following steps.
Step 3: Modify Kernel Boot Options
# Edit the /etc/default/grub file
vi /etc/default/grub
Find the line with “GRUB_CMDLINE_LINUX” and append “rootflags=uquota,pquota” at the end:
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet rootflags=uquota,pquota"
Step 4: Create a Backup and Update grub.cfg
# Create a backup of the grub.cfg file
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig
# Generate a new grub.cfg file
grub2-mkconfig -o /boot/grub2/grub.cfg
Note: The path to grub.cfg may vary on some operating systems, like “/boot/efi/EFI/centos/grub.cfg”.
Step 5: Reboot the System
# Reboot the server
reboot
Step 6: Verify Quota Configuration
# Check the mounting options for the root partition
mount | grep ' / '
You should see “usrquota,prjquota” (or “uquota,pquota”) in the options, indicating that quotas are now enabled.
Step 7: Update User Quota Limits (if needed)
# Add a task to reset user quota limits
echo "action=rewrite&value=quota" >> /usr/local/directadmin/data/task.queue
This guide enables quota support on XFS, allowing you to set up directory quotas and enforce disk quotas as needed.
Leave a Reply