6
卸载、加载/home,并查看/home项
[root@localhost ~]# umount /home/; mount -a
[root@localhost ~]# mount | grep home
/dev/sda3 on /home type ext4 (rw,usrquota,grpquota)
7
quotacheck生成配额文件,结果如下
[root@localhost ~]# qutoacheck -avug
-bash: qutoacheck: command not found
[root@localhost ~]#
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