[iyunv@paylm-vm-rh7 ~]# xfs_quota -x -c 'report' /lvquota/
User quota on /lvquota (/dev/mapper/vg-lv_quota)
Blocks
User ID Used Soft Hard Warn/Grace
---------- --------------------------------------------------
root 0 0 0 00 [--------]
Group quota on /lvquota (/dev/mapper/vg-lv_quota)
Blocks
Group ID Used Soft Hard Warn/Grace
---------- --------------------------------------------------
root 0 0 0 00 [--------]
davis 25600 0 0 00 [--------]
[iyunv@paylm-vm-rh7 ~]# xfs_quota -x -c 'limit bsoft=20M bhard=25M davis' /lvquota/
[iyunv@paylm-vm-rh7 ~]# xfs_quota -x -c 'report' /lvquota/
User quota on /lvquota (/dev/mapper/vg-lv_quota)
Blocks
User ID Used Soft Hard Warn/Grace
---------- --------------------------------------------------
root 0 0 0 00 [--------]
davis 25600 20480 25600 00 [6 days]
Group quota on /lvquota (/dev/mapper/vg-lv_quota)
Blocks
Group ID Used Soft Hard Warn/Grace
---------- --------------------------------------------------
root 0 0 0 00 [--------]
davis 25600 0 0 00 [--------]
[davis@paylm-vm-rh7 lvquota]$ ll
total 15360
-rw-rw-r--. 1 davis davis 15728640 Jan 6 09:36 davis.disk
[davis@paylm-vm-rh7 lvquota]$ du -sh davis.disk
15M davis.disk
[davis@paylm-vm-rh7 lvquota]$ dd if=/dev/zero of=davis.disk1 bs=1M count=15
dd: error writing ‘davis.disk1’: Disk quota exceeded
11+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.0122207 s, 858 MB/s
[davis@paylm-vm-rh7 lvquota]$ du -sh davis.disk1
10M davis.disk1
[davis@paylm-vm-rh7 lvquota]$ xfs_quota
xfs_quota> help
df [-bir] [-hn] [-f file] -- show free and used counts for blocks and inodes
help [command] -- help for one or all commands
print -- list known mount points and projects
quit -- exit the program
quota [-bir] [-gpu] [-hnNv] [-f file] [id|name]... -- show usage and limits
Use 'help commandname' for extended help.
xfs_quota> print
Filesystem Pathname
/ /dev/sda3
/xfs /dev/mapper/vg-lv_xfs
/boot /dev/sda1
/lvquota /dev/mapper/vg-lv_quota (uquota, gquota)
xfs_quota> quota -u davis
Disk quotas for User davis (3000)
Filesystem Blocks Quota Limit Warn/Time Mounted on
/dev/mapper/vg-lv_quota
25600 20480 25600 00 [6 days] /lvquota
xfs_quota>
查看xfs_quota的帮助文件档,可以看到一些相关的例子:
EXAMPLES
Enabling quota enforcement on an XFS filesystem (restrict a user to a
set amount of space).