if [-x /sbin/quotacheck ];then echo "Checking quotas,This may take some time ... " /sbin/quotacheck -avug echo "Done." fi if[ -x /sbin/quotaon ];then echo "Enabling disk quota ... " /sbin/quotaon -avug echo "Done." fi
设定soft quota和hard quota之间的时间: [root@fileserver home]# edquota -t 出现一个 vi 窗口: Grace period before enforcing soft limits for users: Time units may be: days, hours, minutes, or seconds Filesystem Block grace period Inode grace period /dev/hda7 7days 7days 修改成自己所需要的,并保存退出就设置这个时间啦。 您在这之后可能需要重新启动,以使磁盘限额生效。 您可以啦,不过还要注意一些问题,请继续看下去。
6. 检查磁盘空间限制的一致性,系统会自动每次重新启动时,在检查硬盘后进行( /etc/rc.sysinit ),无须您亲手进行。 假若 分区 已经以“读写”方式挂上时,您要小心,例如: [root@fileserver root]# quotacheck /home quotacheck: Quota for users is enabled on mountpoint /home so quotacheck might damage the file. Please turn quotas off or use -f to force checking.
7. 以后您如果要取消磁盘空间和i节点数目的限制,可用以下命令,请看: [root@fileserver root]# quotaoff /home (取消磁盘空间限制。) [root@fileserver root]# quotaon /home (现在启动磁盘空间限制。) [root@fileserver root]# quotaon /home (已经启动磁盘空间限制啦,所以出现以下错误:) quotaon: using /home/aquota.group on /dev/hda7: Device or resource busy quotaon: using /home/aquota.user on /dev/hda7: Device or resource busy