配置磁盘

以root登录,用vi编辑程序打开/etc/fstab,编辑那些包含关于linux分区数据项的行,如下:
/dev/hda3 / ext2 default 1 1
在单词default后加上,usrquota
/dev/hda3 / ext2 default,usrquota 1 1
存盘。
  建立一个叫做quota.user的文件,把该文件设为600
# touch /quota.user
# chmod 600 /quota.user
  完成上面的操作后,用shutdown -r重启动计算机。
  再次以root登录,执行/usr/sbin/edquota命令,如下所示:
# edquota -u cloobie
  它会读入/quota.user文件(这个文件本身是二进制的),并启动你的缺省的编辑器(通常是vi)。
屏幕上显示:
Quota for user cloobie:
/dev/hda3: blocks in use: 58, limits (soft = 0, hard = 0)
inodes in use: 41, limits (soft = 0, hard = 0)
  如果你要把硬盘空间限制设置为 3-5MB,把文件个数设置为500-1000个,可以改为:
Quota for user cloobie:
/dev/hda3: blocks in use: 58, limits (soft = 3000, hard = 5000)
inodes in use: 41, limits (soft = 500, hard = 1000)
存盘。
最后,你还必须设置一个预警期,如下所示:
# edquota -t
  如下你可以把预警期设置为1天,也可以使用分钟或秒。
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for users:
/dev/hda3: block grace period: 1 days, file grace period: 1 days
  现在,你可以使用quota来查看新的配额:
# quota cloobie
Disk quotas for user cloobie(uid 502):
Filesystem blocks quota limit grace files quota limit grace
/dev/hda3 58 3000 5000 41 500 1000
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值