How to manage Linux disk quota using edquota and repquota commands
Linux disk quotas can be set per user, group, or filesystem with the edquota command. The user or group name can be used or the UID or GID for the user or group. To set or modify the disk quota for a user, execute the Linux edquota command as root:
edquota <username>
Example:
[root@RHEL03 ~]# edquota -f /dev/sdb1 tintin
Once the above command is issued, the quota can be edited in a temporary file opened with vi editor, as shown below.
Disk quotas for user tintin (uid 500):
Filesystem blocks soft hard inodes soft hard
/dev/sdb1 40460 45000 50000 11 0 0
To set or modify the quota for a user group, execute the following as root:
edquota -g <groupname>
There is seven days grace period for both inodes and block usage. That means, a user may exceed the soft limit on either resource for up to seven days. After that, further requests by that user to use files will be denied.
To modify the grace period for a filesystem, execute the following as root:
edquota -t
This grace period is used for all users and groups. To set the grace period for a specific user, execute the following as root, where <username> is a username or UID:
edquota -T <username>
To set the grace period for a specific user group, execute the following as root, where <groupname> is a group name or GID:
edquota -T -g <groupname
How to view Linux file system Quotas
The Linux disk quota command “repquota” can be used to view the filesystem quotas.
[root@RHEL03 ~]# repquota -a
*** Report for user quotas on device /dev/sdb1
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 149628 0 0 4 0 0
tintin +- 50000 45000 50000 6days 17 0 0