Quotas are off on Linode Xen VPS? Print

  • 0

If you get this error a client of ours found this blog post which will help others: http://www.daftspunk.com/code/fix-for-file-system-quotas-devroot-symlink-breaks-linode-centos-6-x.

Since Daftspunk has removed the article from his website, I managed to find a cache of his blog so I've posted it here… Please note this is copyright to Daftspunk.

This is a solution to a confusing problem when performing quota checks on CentOS 6.x using Linode/Xen.

When you try quotacheck you get this error:

root@server [~]# quotacheck -a
quotacheck: Cannot stat() mounted device /dev/root: No such file or directory

In troubleshooting the solution, you should check to see if “/dev/root” exists: ll /dev/root

If it does not exist, create a symbolic link to /dev/xvda by running this: ln -s /dev/xvda /dev/root

After the symbolic link is created, you can run your quote check function again. In cPanel this function is : /scripts/fixquotas

All good now. But in some cases, you will reboot your VPS only to find the symbolic link is totally GONE! This is probably caused by a bug in CentOS 6.x on Xen servers.

The fix for this particular problem is to create the link before the code is executed in startup file /etc/rc.sysinit:

# 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

Open /etc/rc.sysinit and search for the code mentioned above. Now place the code below directly before the code mentioned above executes.

# Create link to /dev/root for quota fix
ln -s /dev/xvda /dev/root

This will create the symbolic link right before the quota checks are performed.


Was this answer helpful?

« Back