ReiSer文件系统做限额
感谢回我的贴子!
首先当然要有内核支持:
File systems -->
[*] Quota support
Old quota format support
Quota format v2 support
我用Quota format v2,这模组叫做“quota_v2”。
工具包quota也得装上。
修改/etc/fstab,类似这样子:
QUOTE:
/dev/lv/home
/home
reiserfs
noatime,usrquota,grpquota 0
0
重新挂载有关分区,如:
# mount -o remount /home
检查quota:
# /sbin/quotacheck -cguvamf -F vfsv0
启动:
# /sbin/quotaon -a
为用户tester设置quota,以k为单位:
# edquota -u tester
Disk quotas for user tester (uid 1001):
Filesystem
blocks soft
hard inodes soft
hard
/dev/mapper/lv-home
9306 150000
200000 6
0 0
这
儿有两个数值:soft=150000及hard=200000,hard是用户用量的上限,超过就不能再写入,而soft是警告的上限,超过这个上限,
系统会发出警告,若是超过grace period,容量仍超过soft,则不得再写入。设置grace period:
# edquota -ut
以用户身份查看quota:
$ quota -s
Disk quotas for user tester (uid 1001):
Filesystem blocks
quota limit grace files
quota limit grace
/dev/mapper/lv-home
9306 147M 196M
6
0 0
阅读(1124) | 评论(0) | 转发(0) |