系统之家 - 系统光盘下载网站!

当前位置:系统之家 > 系统教程 > CentOS 6修改磁盘配额限制

CentOS 6如何修改磁盘配额限制(2)

时间:2015-02-10 17:54:22 作者:qipeng 来源:系统之家 1. 扫描二维码随时看资讯 2. 请使用手机浏览器访问: https://m.xitongzhijia.net/xtjc/20150210/37985.html 手机查看 评论

  8、查找、安装 quota

  [root@localhost ~]# find / -name qutoacheck

  [root@localhost ~]#

  [root@localhost ~]# rpm -qa | grep quota

  quota-3.17-20.el6.x86_64

  安装

  [root@localhost ~]# yum -y install quota-3.17-20.el6.x86_64

  Loaded plugins: fastestmirror, refresh-packagekit, security

  Loading mirror speeds from cached hostfile

  * base: centos.ustc.edu.cn

  * extras: centos.ustc.edu.cn

  * updates: centos.ustc.edu.cn

  base | 3.7 kB 00:00

  base/primary_db | 4.6 MB 00:29

  extras | 3.4 kB 00:00

  extras/primary_db | 29 kB 00:00

  updates | 3.4 kB 00:00

  updates/primary_db | 910 kB 00:05

  Setting up Install Process

  Nothing to do

  [root@localhost ~]#

  9、开启限制,生成用户和组限制文件

  [root@localhost ~]# quotacheck -avug

  quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown.

  quotacheck: Scanning /dev/sda3 [/home] done

  quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be substracted.

  quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be substracted.

  quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be substracted.

  quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be substracted.

  quotacheck: Checked 33 directories and 18 files

  quotacheck: Old file not found.

  quotacheck: Old file not found.

  [root@localhost ~]# quotaon -avug

  /dev/sda3 [/home]: group quotas turned on

  /dev/sda3 [/home]: user quotas turned on

  10、增加配额限制

  [root@localhost ~]# edquota -u vbird1

  Disk quotas for user vbird1 (uid 501):

  Filesystem blocks soft hard inodes soft hard

  /dev/sda3 32 8000 10000 8 0 0

  单位是KB

  [root@localhost ~]# edquota -u vbird2

  。。。

  [root@localhost ~]# edquota -p vbird1 vbird2 vbird3 vbird4 vbird5

  11、查看配额

  [root@localhost ~]# repquota -au

  *** Report for user quotas on device /dev/sda3

  Block grace time: 7days; Inode grace time: 7days

  Block limits File limits

  User used soft hard grace used soft hard grace

  ----------------------------------------------------------------------

  root -- 24 0 0 3 0 0

  zxw -- 32 0 0 8 0 0

  vbird1 -- 32 8000 10000 8 0 0

  vbird2 -- 32 8000 10000 8 0 0

  vbird3 -- 32 8000 10000 8 0 0

  vbird4 -- 32 8000 10000 8 0 0

  vbird5 -- 32 8000 10000 8 0 0

  12、开始测试

  [vbird1@localhost ~]$ ll -h

  total 7.6M

  -rw-rw-r--。 1 vbird1 vbird1 1.7M Dec 2 14:01 cont.txt

  -rw-r--r--。 1 root root 49K Dec 2 13:59 install.log

  -rw-rw-r--。 1 vbird1 vbird1 5.8M Dec 2 14:02 v.txt

  [vbird1@localhost ~]$

  vb1写文件到达到软限制

  [vbird1@localhost ~]$ nl cont.txt 》》 v.txt

  sda3: warning, user block quota exceeded.

  达到软限制,警告

  [vbird1@localhost ~]$ ll -h

  total 9.5M

  -rw-rw-r--。 1 vbird1 vbird1 1.7M Dec 2 14:01 cont.txt

  -rw-r--r--。 1 root root 49K Dec 2 13:59 install.log

  -rw-rw-r--。 1 vbird1 vbird1 7.7M Dec 2 14:02 v.txt

  vb1写文件到达到硬限制

  [vbird1@localhost ~]$ nl cont.txt 》》 v.txt

  sda3: write failed, user block limit reached.

  nl: write error: Disk quota exceeded

  达到硬限制,报错

  [vbird1@localhost ~]$

  [vbird1@localhost ~]$ ll -h

  total 9.8M

  -rw-rw-r--。 1 vbird1 vbird1 1.7M Dec 2 14:01 cont.txt

  -rw-r--r--。 1 root root 49K Dec 2 13:59 install.log

  -rw-rw-r--。 1 vbird1 vbird1 8.1M Dec 2 14:03 v.txt

  vb1再写就不让写了

  [vbird1@localhost ~]$ nl cont.txt 》》 v.txt

  nl: write error: Disk quota exceeded

  [vbird1@localhost ~]$ ll -h

  total 9.8M

  -rw-rw-r--。 1 vbird1 vbird1 1.7M Dec 2 14:01 cont.txt

  -rw-r--r--。 1 root root 49K Dec 2 13:59 install.log

  -rw-rw-r--。 1 vbird1 vbird1 8.1M Dec 2 14:03 v.txt

  上面就是CentOS 6修改磁盘配额限制的方法介绍了,本文主要介绍的是CentOS增加磁盘配额限制方面的修改,如果你需要减少磁盘配额限制不可使用本文方法进行修改。

发表评论

0

没有更多评论了

评论就这些咯,让大家也知道你的独特见解

立即评论

以上留言仅代表用户个人观点,不代表系统之家立场

其他版本软件

热门教程

人气教程排行

Linux系统推荐

扫码关注
扫码关注

扫码关注 官方交流群 软件收录