系統(tǒng)之家 - 系統(tǒng)光盤下載網(wǎng)站!

當(dāng)前位置:系統(tǒng)之家 > 系統(tǒng)教程 > CentOS 6修改磁盤配額限制

CentOS 6如何修改磁盤配額限制(2)

時(shí)間:2015-02-10 17:54:22 作者:qipeng 來源:系統(tǒng)之家 1. 掃描二維碼隨時(shí)看資訊 2. 請(qǐng)使用手機(jī)瀏覽器訪問: https://m.xitongzhijia.net/xtjc/20150210/37985.html 手機(jī)查看 評(píng)論

  8、查找、安裝 quota

 。踨oot@localhost ~]# find / -name qutoacheck

  [root@localhost ~]#

 。踨oot@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

 。踨oot@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.

 。踨oot@localhost ~]# quotaon -avug

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

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

  10、增加配額限制

 。踨oot@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

 。踨oot@localhost ~]# edquota -u vbird2

  。。。

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

  11、查看配額

 。踨oot@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、開始測試

 。踲bird1@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寫文件到達(dá)到軟限制

 。踲bird1@localhost ~]$ nl cont.txt 》》 v.txt

  sda3: warning, user block quota exceeded.

  達(dá)到軟限制,警告

 。踲bird1@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寫文件到達(dá)到硬限制

 。踲bird1@localhost ~]$ nl cont.txt 》》 v.txt

  sda3: write failed, user block limit reached.

  nl: write error: Disk quota exceeded

  達(dá)到硬限制,報(bào)錯(cuò)

  [vbird1@localhost ~]$

 。踲bird1@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再寫就不讓寫了

 。踲bird1@localhost ~]$ nl cont.txt 》》 v.txt

  nl: write error: Disk quota exceeded

 。踲bird1@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增加磁盤配額限制方面的修改,如果你需要減少磁盤配額限制不可使用本文方法進(jìn)行修改。

標(biāo)簽 磁盤 CentOS

發(fā)表評(píng)論

0

沒有更多評(píng)論了

評(píng)論就這些咯,讓大家也知道你的獨(dú)特見解

立即評(píng)論

以上留言僅代表用戶個(gè)人觀點(diǎn),不代表系統(tǒng)之家立場

其他版本軟件

熱門教程

人氣教程排行

Linux系統(tǒng)推薦

官方交流群 軟件收錄