CentOS中quotacheck创建aquota.user和aquota.group文件失败如何解决
发布:smiling 来源: PHP粉丝网 添加日期:2015-05-06 17:05:13 浏览: 评论:0
quotacheck是linux中检查磁盘的使用空间与限制,执行quotacheck指令,扫描挂入系统的分区,并在各分区的文件系统根目录下产生quota.user和quota.group文件,设置用户和群组的磁盘空间限制.
今天在看CentOS 6.5的 磁盘配额quotacheck命令时,已经挂载分区到/home目录下,执行命令然后遇到错误提示,最后找到了原因,解决了问题.
解释:aquota.group与aqouta.user分别是组以及用户磁盘配额需要的配置文件,如果没有这两个文件,则磁盘配额是不会生效的.
执行命令:
- # quotacheck -augv123456789101112 [root@root ~]# quotacheck -augv
- 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/sda6 [/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 4 directories and 6 files
- quotacheck: Cannot create new quotafile /home/aquota.user.new: Permission denied
- quotacheck: Cannot initialize IO on new quotafile: Permission denied
- quotacheck: Cannot create new quotafile /home/aquota.group.new: Permission denied
- quotacheck: Cannot initialize IO on new quotafile: Permission denied
- --phpfensi.com
- [root@root ~]# ll /home/
- total 24
- drwx------. 2 root root 16384 Nov 25 16:07 lost+found
- drwx------. 2 test1 test 4096 Nov 25 17:20 test1
- drwx------. 2 513 513 4096 Nov 25 17:21 test2
出现上面的错误,提示不能创建/home/aquota.user /home/aquota.group 这2个文件,没有这个文件,没有权限操作,在home目录也没有发现这2个文件.
原因找到了,需要关闭selinux,然后就可以执行了,关闭selinux的命令是#setenforce 0,重新执行#quotacheck -auvg 就可以了,同样也会有错误提示,不用管他,之后在/home目录就有配置文件了.
- [root@root ~]# 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/sda6 [/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 4 directories and 6 files
- quotacheck: Old file not found.
- quotacheck: Old file not found.
- [root@root ~]# ll /home/
- total 40
- -rw-------. 1 root root 8192 Nov 25 17:42 aquota.group
- -rw-------. 1 root root 7168 Nov 25 17:42 aquota.user
- drwx------. 2 root root 16384 Nov 25 16:07 lost+found
- drwx------. 2 test1 test 4096 Nov 25 17:20 test1
- drwx------. 2 513 513 4096 Nov 25 17:21 test2
Tags: CentOS quotacheck aquota user
相关文章
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)