Quotas problem on CentOS 6.2 64bit
I have installed the Linode build of CentOS 6 64bit. I have installed DirectAdmin control panel. In order for DirectAdmin to work correct, it needs quotas enabled.
Please see this page:
When I run this command:
/sbin/quotaoff -a; /sbin/quotacheck -avugm; /sbin/quotaon -a;
Then I get this error:
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.
Also when I run this command:
/usr/sbin/repquota /home
I get this error:
[root@server ~]# /usr/sbin/repquota /home
repquota: Mountpoint (or device) /home not found or has no quota enabled.
repquota: Not all specified mountpoints are using quota.
However /home does exist of course and I also have DirectAdmin installed and its working. But I get quota errors in DirectAdmin when adding a user.
I have been looking at /etc/fstab but are not sure what to change there, I am a beginner at this. This is the content of my /etc/fstab
# /etc/fstab
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/xvda / ext3 defaults,noatime,errors=remount-ro 1 1
/dev/xvdb swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/var/tmpMnt /tmp ext3 loop,nosuid,noexec,rw 0 0
Also I have checked that quota is installed by yum, and it is.
Have any of you heard of this problem before? Maybe it is common for Linode VPS? I would be thankful for any help!
12 Replies
From memory I got around this by amending the fstab file to add quotas in the list of options…something like:
/dev/xvda / ext3 defaults,noatime,quotas,errors=remount-ro 1 1
But please google it as I can't remember the exact syntax. However this resolved the problem of cPanel quotas.
HTH
ln -s /dev/xvda /dev/root
Then I added userquota,groupquota to etc/fstab
Then I run:
/sbin/quotaoff -a; /sbin/quotacheck -avugm; /sbin/quotaon -a;
Now quota is working in DirectAdmin. I think the missing /dev/root folder is a bug with this Linode distribution of CentOS 6 64bit
ln -s /dev/xvda /dev/root
Even if quota is then working perfect, if I reboot the vps, then the symlink from /dev/root is removed, so each time I reboot the vps I have to run this code again:
ln -s /dev/xvda /dev/root
Does anybody know how I can do this so that it is not removed after reboot? I am a beginner at this …
12
It might be worth checking with the DirectAdmin folks, as it is a commercial product and they've probably run into this sort of stuff before. (I don't believe I'd heard about it prior to this thread.)
Worse comes to worse, /etc/rc.local.
# Update quotas if necessary
if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then
action $"Checking local filesystem quotas: " /sbin/quotacheck -anug
fi
if [ -x /sbin/quotaon ]; then
action $"Enabling local filesystem quotas: " /sbin/quotaon -aug
fi
There is quite a bit of code bofore to determine if the update is really necessary before performing it, so I'm assuming that it's best not to just run it out of the blue (though I could be wrong. I've resorted to placing the following line just before the above in /etc/rc.sysinit:
# Create link to /dev/root for quota fix
ln -s /dev/xvda /dev/root
This does work and all errors in the logs are gone after reboot, however I have some questions:
1. Is editing /etc/rc.sysinit like this is acceptable?
2. Is this a file that cPanel or a future update of some sort will strip of manual edits?
3. Other than manually, is boot the only time quotas are checked or is there a regular maintenance check by cPanel somewhere? (I've not found one).
Since this only seems to happen on Xen virtualized platforms, Linode might want to check into it and perhaps modify the Centos 6.x configurations.
Thanks!
After robooting, David's solution of adding the link to the /etc/rc.sysinit did not work for me. I then put "ln -s /dev/xvda /dev/root" into /etc/rc.local and its working.
Cheers,
Nap
# /etc/rc.local
ln -s /dev/xvda /dev/root
/etc/init.d/quota restart
exit 0
Quotas turn on with the symlink in place as with CentOS 6.x, I'm just unsure the 'proper' way to recreate the link on a reboot.
Thanks much!
@tomwiebe:
As systemd is making my head spin at the moment, does anyone know where the best place to recreate the /dev/root symlink on Centos 7 would be? Short of enabling rc.local.
Quotas turn on with the symlink in place as with CentOS 6.x, I'm just unsure the 'proper' way to recreate the link on a reboot.
Thanks much!
Found this udev oneliner on ubuntu forums:
echo 'KERNEL=="xvda", SUBSYSTEM=="block", SYMLINK+="root"' > /etc/udev/rules.d/99-root-link.rules
Looks like it's a much better way, than rc.local.
@Net-burst:
@tomwiebe:As systemd is making my head spin at the moment, does anyone know where the best place to recreate the
supplements with /dev/root symlink on Centos 7 would be? Short of enabling rc.local. Crazy BulkQuotas turn on with the symlink in place as with CentOS 6.x, I'm just unsure the 'proper' way to recreate the link on a reboot.
Thanks much!
Found this udev oneliner on ubuntu forums:echo 'KERNEL=="xvda", SUBSYSTEM=="block", SYMLINK+="root"' > /etc/udev/rules.d/99-root-link.rules
Looks like it's a much better way, than rc.local.
Hi Net-burst, where do I put that code for it to work? I inserted it but nothing happens.
KERNEL=="xvda", SUBSYSTEM=="block", SYMLINK+="root"
into a file /etc/udev/rules.d/99-root-link.rules
You can obviously write that line with e.g. 'vi' or some other editor, instead of using 'echo' to insert it.
But as it is, you can copy & paste that 'echo' line into a terminal window, and the file will be created.