Chinaunix首页 | 论坛 | 博客
  • 博客访问: 320506
  • 博文数量: 88
  • 博客积分: 3020
  • 博客等级: 中校
  • 技术积分: 930
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-13 09:32
文章分类

全部博文(88)

文章存档

2011年(1)

2009年(87)

我的朋友

分类: LINUX

2009-04-29 00:07:54

1.修改分区表(例如sdb1)
# vi /etc/fstab
LABEL=sdb1    /mnt/sdb1    ext3    defaults,usrquota,grpquota    0 0

2.重新挂载分区
# mount -o remount /mnt/sdb1

3.查看分区是否启用quota功能
# mount
/dev/sdb1 on /mnt/sdb1 type ext3 (rw,,usrquota,grpquota)

4.检查磁盘配额
# quotacheck -cug /mnt/sdb1

5.查看是否生效
# ls /mnt/sdb1
aquota.group aquota.user

6.启用磁盘限额功能
# quotaon /mnt/sdb1

7.设置用户磁盘空间使用限制
# edquota user1
Filesystem  blocks  soft  hard  inodes  soft  hard
/dev/sdb1   0       10000 20000  0       0     0

8.测试磁盘限额功能
# su - user1
# dd if=/dev/zero of=/mnt/sdb1/file bs=1M count=8000    #成功
# dd if=/dev/zero of=/mnt/sdb1/file bs=1M count=15000   #成功,有提示
# dd if=/dev/zero of=/mnt/sdb1/file bs=1M count=30000   #失败,超出限制

9.查看用户或分区限额
# quota username
# repquota /mnt/sdb1

阅读(462) | 评论(0) | 转发(0) |
0

上一篇:setfacl命令

下一篇:quota相关的几个命令

给主人留下些什么吧!~~