Tag Archives: quota

directadmin面板,磁盘配额错误提示quotacheck: Cannot stat() mounted device /dev/root: No such file or directory

directadmin,da面板,磁盘配额quota问题,也算是DA面板的一个小bug了,你说他不重要吧,也重要。如果自用,当然不重要了。如果是销售虚拟主机,那就非常重要了,毕竟涉及到虚拟主机套餐的磁盘配额,如果磁盘配额失效了,那就无法控制客户是否使用磁盘超标了。

接之前的教程:http://da.yqf.me/49.html,今天帮客户安装DA面板,又遇到新的难题。

[[email protected] ~]# /sbin/quotaoff -a; /sbin/quotacheck -avugm; /sbin/quotaon -a;
quotaoff: Cannot stat() mounted device /dev/root: No such file or directory
quotacheck: Cannot stat() mounted device /dev/root: No such file or directory
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.
quotaon: Cannot stat() mounted device /dev/root: No such file or directory

敲了一段命令,结果提示找不到/dev/root这个设备。

解决方案

ln -s /dev/xvda /dev/root

/dev/xvda视具体情况修改成为实际分区。

不过,重启后你会发现那个错误又出现了。所以,要彻底解决那问题,就必须在启动时自动创建一个softlink,即我们要写一个脚本放到udev里,运行下下面这个一步到位的命令即可。

echo 'KERNEL=="xvda", SUBSYSTEM=="block", SYMLINK+="root"' > /etc/udev/rules.d/99-root-link.rules

 

DirectAdmin创建虚拟主机提示Error with system Quotas

User yqf1 created

Details

Unix User created successfully

Error with system Quotas
setquota: Mountpoint (or device) / not found or has no quota enabled. setquota: Not all specified mountpoints are using quota.
Debug Guide
User’s data directory created successfully
Domains directory created successfully
Domains directory created successfully in user’s home

Domain Created Successfully

User added to ssh config file.

2016年3.14日更新。好几年的问题,其实是Directadmin的一个bug,今天帮客户安装DA面板,系统是centos 6.x 64位,依然还是存在这个问题,耐心看了下官方的教程。简单处理下就可以了。

加入我们就一个盘,根目录是/,我们df -h是可以查看磁盘规划的。

我们执行 /usr/sbin/repquota / ,如果磁盘配额生效的,那会显示类似下面的:

[[email protected] ~]# /usr/sbin/repquota /
*** Report for user quotas on device /dev/xvda1
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
———————————————————————-
root — 1985016 0 0 70212 0 0
daemon — 8 0 0 3 0 0
mail — 96 0 0 35 0 0
ftp — 1656 0 0 103 0 0
abrt — 24 0 0 4 0 0
haldaemon — 8 0 0 2 0 0
ntp — 8 0 0 2 0 0
named — 40 0 0 10 0 0
apache — 32 0 0 8 0 0
diradmin — 209608 0 0 3434 0 0
mysql — 31712 0 0 131 0 0
majordomo — 356 0 0 34 0 0
webapps — 73604 0 0 6126 0 0
dovecot — 0 0 0 8 0 0
admin — 132 0 0 33 0 0

问题就是他不显示正常的磁盘配额,所以我们要修改下配置:

/sbin/quotaoff -a; /sbin/quotacheck -avugm; /sbin/quotaon -a;

先执行下这个,如果还是报错。

那就修改下/etc/fstab设置,vi /etc/fstab

类似,添加红色的,usrquota,grpquota就可以了。

# Device                Mountpoint      FStype  Options            Dump    Pass#
/dev/ad0s1a             /               ext3     rw,usrquota,grpquota 1       1
/dev/ad0s1e             /tmp            ext3     rw                 2       2
proc                    /proc           procfs   rw                 0       0

然后重启下机器。

然后再执行下:

/sbin/quotaoff -a; /sbin/quotacheck -avugm; /sbin/quotaon -a;

会看见磁盘配额生效了:

[[email protected] ~]# /sbin/quotaoff -a; /sbin/quotacheck -avugm; /sbin/quotaon -a;
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/xvda1 [/] done
quotacheck: Cannot stat old user quota file //aquota.user: No such file or directory. Usage will not be substracted.
quotacheck: Cannot stat old group quota file //aquota.group: No such file or directory. Usage will not be substracted.
quotacheck: Cannot stat old user quota file //aquota.user: No such file or directory. Usage will not be substracted.
quotacheck: Cannot stat old group quota file //aquota.group: No such file or directory. Usage will not be substracted.
quotacheck: Checked 11747 directories and 73601 files
quotacheck: Old file not found.
quotacheck: Old file not found.

===========================

[[email protected] ~]# /usr/sbin/repquota /
*** Report for user quotas on device /dev/xvda1
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
———————————————————————-
root — 1985016 0 0 70212 0 0
daemon — 8 0 0 3 0 0
mail — 96 0 0 35 0 0
ftp — 1656 0 0 103 0 0
abrt — 24 0 0 4 0 0
haldaemon — 8 0 0 2 0 0
ntp — 8 0 0 2 0 0
named — 40 0 0 10 0 0
apache — 32 0 0 8 0 0
diradmin — 209608 0 0 3434 0 0
mysql — 31712 0 0 131 0 0
majordomo — 356 0 0 34 0 0
webapps — 73604 0 0 6126 0 0
dovecot — 0 0 0 8 0 0
admin — 132 0 0 33 0 0

各方面正常以后,再执行下:

echo “action=tally&value=all” >> /usr/local/directadmin/data/task.queue

就ok了。