|
|

楼主 |
发表于 2006-9-7 11:52:50
|
显示全部楼层
首先编译内核:
File systems -->
Quota support
<M> Old quota format support
<M> Quota format v2 support
安装:emerge quota
修改/etc/fstab,类似这样子:
/dev/lv/home /home reiserfs noatime,usrquota,grpquota 0 0
注意usrquota、grpquota不是userquota,groupquota
重新挂载有关分区,如:
# mount -o remount /home 如果不行,请重启
检查quota:
# /sbin/quotacheck -cguvamf -F vfsv0
启动quota:
# /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
race period before enforcing soft limits for users:
Time units may be: days, hours, minutes, or seconds
Filesystem Block grace period Inode grace period
/dev/hda5 2hours 7days
以用户身份查看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 |
|