Group ID Used Soft Hard Warn/Grace Used Soft Hard Warn/Grace
----------
-------------------
--------------
---------------------------------
myquotagrp 60K
950M 1G
00 [
------
] 36 0 0 00 [
------
]
范例三:
定一下
grace time
14
天吧!
[root@study ~]#
xfs_quota
-
x
-
c "timer
-
ug
-
b 14days" /home
[root@study ~]#
xfs_quota
-
x
-
c "stat
e" /home
User quota state on /home (/dev/mapper/centos
-
home)
.....(
省略
).....
Blocks grace time: [
14 days
00:00:30]
Inodes grace time: [7 days 00:00:30]
Realtime Blocks grace time: [7 days 00:00:30]
范例四:以
myquota1
户测试
quota
是否真的
实际运
作呢?
[root@study ~]#
su
-
myquota1
[myquota1@study ~]$
dd if=/dev/zero of=123.img bs=1M count=310
dd: error writing
'
123.img
'
: Disk quota exceeded
300+0 records in
299+0 records out
314552320 bytes (315 MB) copied, 0.181088 s, 1.7 GB/s
[myquota1@study ~]$
ll
-
h
-
rw
-
r
--
r
--
. 1 myquota1 myquotagrp
300M
Jul 24 21:38 123.img
[myquota1@study ~]$
exit
[root@study ~]#
xfs_quota
-
x
-
c "report
-
ubh" /home
User quota on /home (/dev/mapper/centos
-
home)
Blocks
User ID Used Soft Hard
Warn/Grace
----------
---------------------------------
myquota1 300M 250M 300M 00 [13 days]
myquota2 12K 250M 300M 00 [
------
]
#
myquota1
的磁
用量已
破表,所以
然就
可怕的
grace time
这样就直½制做好
quota
啰!看起来也是挺简单啦!
14.1.6
实作
Quota
流程
-4
project
的限制
(
针对目录限制
) (Optional)
现在让我们来想一想,如果需要限制的是目录而不是群组时,那该如何处理呢?举例来说,我们要限
制的是
/home/myquota
这个目录本身,
而不是针对
myquotagrp
这个群组啊!这两种设定方法的意
义不同喔!例如,前一个小½谈到的测试范例来说,
myquota1
已经消耗了
300M
的容量,而
/home/myquota
其实还没有任何的使用量
(
因为在
myquota1
的家目录做的
dd
指令
)
不过如果你
使用了
xfs_quota -x -c "report -h" /home
这个指令来查看,就会发现其实
myquotagrp
已经用掉了
300M
了!
如此一来,对于目录的限制来说,就不会有效果!