首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 操作系统 > Linux > 硬盘限额的实现
【标  题】:硬盘限额的实现
【关键字】:
【来  源】:http://www.cublog.cn/u/21336/showart.php?id=254174

硬盘限额的实现

硬盘限额
在/etc/fstab文件中找到要进行限额的目录.在此以/home目录下为例:

# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
LABEL=/home             /home                   ext3    defaults,usrquota,grpquota   1 2
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
LABEL=/usr              /usr                    ext3    defaults        1 2
LABEL=/var              /var                    ext3    defaults        1 2
LABEL=SWAP-hda12        swap                    swap    defaults        0 0
此例为我的fstab文件,可以看到在选项中加usrquota和grpquota两个文件.然后到/home目录下新建两个文件 touch quota.group和quota.user,重启一下系统才可升效.
以root身份登陆后打开quota:     quotaon -avug
执行扫瞄: quotacheck -avug
此时ll /home下可以发现原来quota.group和quota.user为0字节的文件变大了.
设置硬盘限额选项:
edquota -u username
isk quotas for user gaofei (uid 501):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/hda9                       100        500       1000         12      500     1000
将已经设置好的用户做为模板给其他用户edquota -p test user1,user2,user*
用repquota -avug来查看.
有时可能要重新执行一下quotacheck -avug来重新扫瞄一下磁盘才能查看到新加用户的信息.
对于quotas中的hard soft 的理解.
Filesystem                   blocks       soft       hard     inodes     soft     hard
区块的软性限制与硬性限制                                     索引节点的软性限制与硬性限制设
如要超出限制大小,默认是在7days删除.
 
BusyBox 简化嵌入式 Linux 系统 (转载):【上一篇】
重装DEBIAN的注意事项:【下一篇】
【相关文章】
没有相关文章
【随机文章】
  • QQ安全软件,保护你的QQ(3)
  • 就是说对你有影响的朋友
  • 全面了解ADSL/Cable共享路由器
  • VB网络篇游戏编程技巧指南
  • 在java中如何向oracle sp中传递自定义对象
  • Based on old cisco router exploit
  • 游戏编程新手指南
  • 一些问题
  • ex implement
  • WinForm控件开发总结(八)-----为属性提供弹出式编辑对话框
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.