Member-only story
Fix XFS error on Linux “Can't enable enforcement when quota off
”
2 min readDec 4, 2024
The error message Can't enable enforcement when quota off
indicates that quotas are not enabled at the filesystem level yet. To resolve this, you need to ensure that the filesystem is mounted with quota options and then enable quotas using xfs_quota
.
Steps to Fix:
- Check Current Mount Options: Use the following command to verify if the quota options are enabled on the filesystem:
mount | grep xfs
- Look for the
usrquota
orgrpquota
options. If they are missing, quotas are not enabled at the mount level. - Update
/etc/fstab
to Enable Quotas: Edit the/etc/fstab
file and add theusrquota
and/orgrpquota
options to the mount point. For example:
/dev/sdX / xfs defaults,uquota,gquota 0 0
- Replace
/dev/sdX
with your actual device and/
with the appropriate mount point. - Remount the Filesystem: After updating
/etc/fstab
, remount the filesystem to apply the new options:
sudo mount -o remount /
- Enable Quotas: Once the filesystem is remounted with quota options, enable quotas using the
xfs_quota
command:
sudo xfs_quota -x -c 'report' /
- Verify Quotas: To confirm that quotas are now enabled, run:
sudo xfs_quota -x -c 'report' /