2024年11月CentOS 6如何修改磁盘配额限制(2)

发布时间:

  ⑴、查找、安装 quota

  ⑵[rootlocalhost ~]# find / -name qutoacheck

  ⑶[rootlocalhost ~]#

  ⑷[rootlocalhost ~]# rpm -qa | grep quota

  ⑸quota-.-.el.x_

  ⑹[rootlocalhost ~]# yum -y install quota-.-.el.x_

  ⑺Loaded plugins: fastestmirror, refresh-packagekit, security

  ⑻Loading mirror speeds from cached hostfile

  ⑼* base: centos.ustc.edu.

  ⑽* extras: centos.ustc.edu.

  ⑾* updates: centos.ustc.edu.

  ⑿base | . kB :

  ⒀base/primary_db | . MB :

  ⒁extras | . kB :

  ⒂extras/primary_db | kB :

  ⒃updates | . kB :

  ⒄updates/primary_db | kB :

  ⒅Setting up Install Process

  ⒆Nothing to do

  ⒇[rootlocalhost ~]#

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

  ⒉[rootlocalhost ~]# 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/sda [/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 directories and files

  ⒑quotacheck: Old file not found.

  ⒒quotacheck: Old file not found.

  ⒓[rootlocalhost ~]# quotaon -avug

  ⒔/dev/sda [/home]: group quotas turned on

  ⒕/dev/sda [/home]: user quotas turned on

  ⒖[rootlocalhost ~]# edquota -u vbird

  ⒗Disk quotas for user vbird (uid :

  ⒘Filesystem blocks soft hard inodes soft hard

  ⒙/dev/sda

  ⒚[rootlocalhost ~]# edquota -u vbird

  ⒛[rootlocalhost ~]# edquota -p vbird vbird vbird vbird vbird

  ①[rootlocalhost ~]# repquota -au

  ②*** Report for user quotas on device /dev/sda

  ③Block grace time: days; Inode grace time: days

  ④Block limits File limits

  ⑤User used soft hard grace used soft hard grace

  ⑥----------------------------------------------------------------------

  ⑦root --

  ⑧zxw --

  ⑨vbird --

  ⑩vbird --

  Ⅰvbird --

  Ⅱvbird --

  Ⅲvbird --

  Ⅳ[vbirdlocalhost ~]$ ll -h

  Ⅴtotal .M

  Ⅵ-rw-rw-r--。 vbird vbird .M Dec : cont.txt

  Ⅶ-rw-r--r--。 root root K Dec : install.log

  Ⅷ-rw-rw-r--。 vbird vbird .M Dec : v.txt

  Ⅸ[vbirdlocalhost ~]$

  Ⅹvb写文件到达到软限制

  ㈠[vbirdlocalhost ~]$ nl cont.txt 》》 v.txt

  ㈡sda: warning, user block quota exceeded.

  ㈢达到软限制,警告

  ㈣[vbirdlocalhost ~]$ ll -h

  ㈤total .M

  ㈥-rw-rw-r--。 vbird vbird .M Dec : cont.txt

  ㈦-rw-r--r--。 root root K Dec : install.log

  ㈧-rw-rw-r--。 vbird vbird .M Dec : v.txt

  ㈨vb写文件到达到硬限制

  ㈩[vbirdlocalhost ~]$ nl cont.txt 》》 v.txt

  sda: write failed, user block limit reached.

  nl: write error: Disk quota exceeded

  达到硬限制,报错

  [vbirdlocalhost ~]$

  [vbirdlocalhost ~]$ ll -h

  total .M

  -rw-rw-r--。 vbird vbird .M Dec : cont.txt

  -rw-r--r--。 root root K Dec : install.log

  -rw-rw-r--。 vbird vbird .M Dec : v.txt

  vb再写就不让写了

  [vbirdlocalhost ~]$ nl cont.txt 》》 v.txt

  nl: write error: Disk quota exceeded

  [vbirdlocalhost ~]$ ll -h

  total .M

  -rw-rw-r--。 vbird vbird .M Dec : cont.txt

  -rw-r--r--。 root root K Dec : install.log

  -rw-rw-r--。 vbird vbird .M Dec : v.txt

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