CentOS 8 And Xfs_quota

Home » CentOS » CentOS 8 And Xfs_quota
CentOS 1 Comment

Folks

I’m trying to use xfs_quota to keep track of disk space usage for my users. The documentation states that I should specify “uquota” as an option on the mount data in /etc/fstab. Yet, I cannot find the entry in fstab that corresponds to the Logical Volume that ends up being mounted on /home1.

The system in question was installed on a single disk system. Later, after install, I added a second disk, created a Logical Volume on it, and mounted it as /home1, where all the user data gets stored. It holds an xfs file system.

Upon examining /etc/fstab, there’s no evidence of the second disk, yet it does get mounted:

[root@ape ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Fri May 1 21:05:38 2020
#
# 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/cl_ape-root / xfs defaults 0 0
UUID

One thought on - CentOS 8 And Xfs_quota

  • Here is what I have:

    /etc/fstab
    —-
    LABEL=/home /home xfs defaults,usrquota 1 2
    —-

    once usrquota is in fstab, unmount and mount again /home; then you will see

    # mount | grep home
    /dev/sdb1 on /home type xfs (rw,usrquota)

    (or similar)

    To set quotas once for all users (and any users added in a future):

    xfs_quota -x -c “limit bsoft=9g bhard=10g -d” /home

    or make some individual quota different than already set for everyone:

    xfs_quota -x -c “limit bsoft=7g bhard=8g valeri” /home

    Here you should be done. In fact, you will not see quota status, occupancies of given user until the user writes something after the quotas had been set.

    I hope, this helps.

    Valeri


    ++++++++++++++++++++++++++++++++++++++++
    Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247
    ++++++++++++++++++++++++++++++++++++++++