repquota stands for report for quota.
This will display filesystem usage and quota information on your system.
1. Basic Usage
For the basic usage, as root user, execute the repquota command and pass the mount point as parameter.
- repquota / – This will display the quota usage for root filesystem
- repquota /home – This will display the quota usage for /home filesystem
- repquota /dev/sdc1 – You can also pass the partition name. This will display the quota for /dev/sdc1 partition
If a filesystem doesn’t have quota enabled, you’ll get the following error message:
# repquota /home repquota: Mountpoint (or device) /home not found or has no quota enabled. repquota: Not all specified mountpoints are using quota.
When a filesystem has the quota enabled, you’ll get the report which will display both “Blocks” and “Files” information for each and every user. i.e How many blocks are used, and how many files are used, what is the current soft and hard limits, along with the grace period information as shown below.
# repquota / *** Report for user quotas on device /dev/sda1 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- ramesh -- 10540 0 0 39 0 0 john +- 65316 100 100 29:07 4197 0 0 raj -- 28096244 0 0 726926 0 0
2. Verbose and Human Readable Format
The verbose mode (-v option), will display all the quotas even when there is no usage. This will also provide some statistics information at the bottom of the report.
The human readable mode (-s option), will display the space in appropriate units (for example: kilobytes, etc.)
# repquota -sv / *** Report for user quotas on device /dev/sda1 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- ramesh -- 10540 0 0 39 0 0 john +- 65316 100 100 29:05 4197 0 0 raj -- 27438M 0 0 727k 0 0 Statistics: Total blocks: 9 Data blocks: 1 Entries: 18 Used average: 18.000000
3. Report Group Usage
By default repquota will display the quotas for users (the -u option).
If you want to display the quota for the groups, use the -g option as shown below.
# repquota -gs / *** Report for group quotas on device /dev/sda1 Block grace time: 7days; Inode grace time: 7days Block limits File limits Group used soft hard grace used soft hard grace ---------------------------------------------------------------------- root -- 12842M 0 0 56792 0 0 dba -- 310M 0 0 4024 0 0 sysadmin -- 27451M 0 0 728k 0 0
To display both uses and group, use both -u and -g option together as shown below.
# repquota -ugs /
4. Display All FS Quota
Use the -a option, which will display quota on all the filesystem as specified in the /etc/mtab file, and those that have quota enabled.
# repquota -a
5. Don’t Translate UID/GID
When you use -n option, it will not translate the userid and groupid (UID and GID) to the corresponding names. When you have lot of users or groups, using this option will be fast.
# repquota -usn / *** Report for user quotas on device /dev/sda1 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- #500 -- 10540 0 0 39 0 0 #501 +- 65316 100 100 29:02 4197 0 0 #502 -- 27438M 0 0 727k 0 0
6. Truncate Long Names
If you have a long username (for example: johnleesmith), -t option will display only the first 9 character to keep the report pretty as shown below.
# repquota -ust / User used soft hard grace used soft hard grace ---------------------------------------------------------------------- ramesh -- 10540 0 0 39 0 0 john +- 65316 100 100 28:59 4197 0 0 raj -- 27438M 0 0 727k 0 0 johnleesm -- 310M 0 0 4025 0 0
7. Display Grace Period in Seconds
When user is currently in the grace period, -p option will display the values in the grace column in “seconds”. This might be helpful when you are writing a custom shell script which will parse the output of the repquota command to generate some alerts based on the grace period time in seconds.
# repquota -ustp / *** Report for user quotas on device /dev/sda1 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- ramesh -- 10540 0 0 0 39 0 0 0 john +- 65316 100 100 1392932008 4197 0 0 0 raj -- 27438M 0 0 0 727k 0 0 0