CentOS Cannot stat() mounted device /dev/root

By | November 14, 2012

cannot stat() mounted device /dev/root No such file or directory

CentOS 6.2 & Xen Linode VPS

The DISK USED in both cPanel & WHM, do not reflect correct data size.

According to cPanel, I require /dev/root in order for userquota to be mounted.

root@host [/]# quota -sv
quota: Cannot stat() mounted device /dev/root: No such file or directory

As such, cPanel cannot run it’s account usage calculation properly (database sizes are calculated separately).

According to cPanel,
It will likely require that /dev/ assuming the kernel does not force create it when usrquota is enabled. The primary partition should also be mounted with usrquota, and currently, it doesn’t appear that journaled quotas are supported by cPanel at this time, and will likely interfere with functionality, we would recommend disabling it.


Someone posted on cPanel’s forum the problem with solution.
They resolved there error, by contacting hosting VPS provider, and host made it so VPS is booted with it’s own kernal.

However, if you’re using Linode..
“I’m not sure Linode would do that for you but it’s definitely their problem and you may ask them to update their guest systems kernel because you experience problems. Or just use my other work around – which is the best way to live in that situation.” -Grigor

Just create a new rule for the udev daemon and add:
# KERNEL==”xvda1″, SUBSYSTEM==”block”, SYMLINK+=”root”

Here’s how to do it in one line:
# echo ‘KERNEL==”xvda1″, SUBSYSTEM==”block”, SYMLINK+=”root”‘ > /etc/udev/rules.d/99-root-link.rules

and reboot!
# reboot


Resources:

Quota Error on CentOS & Xen: http://forums.cpanel.net/f5/frustrating-quota-error-centos-6-2-xen-260462.html
Quotas problem on CentOS 6.2 64bit: http://forum.linode.com/viewtopic.php?t=8294
How the fstab is commonly used: http://en.wikipedia.org/wiki/Fstab
Fix for File System Quotas: http://www.daftspunk.com/code/fix-for-file-system-quotas-devroot-symlink-breaks-linode-centos-6-x