Quota + kernel 3.x + Xen = "Cannot stat() mounted device /dev/root: No such file or directory"?

Help
2013-05-13
2013-05-16
  • Hiya,

    I'm trying to set up quota on a Xen VPS from Linode running kernel 3.8.4-x86_64-linode31, but unfortunately I'm running into a problem. I've installed the tools, added "usrquota" to the options for the partition (/) that I want to set quotas on in /etc/fstab, remounted the partition, and am now trying to run "quotacheck -mcu /" to create the aquota.user file. Unfortunately, when I do this, I receive this error:

    quotacheck: Cannot stat() mounted device /dev/root: No such file or directory
    quotacheck: Mountpoint (or device) / not found or has no quota enabled.
    quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.

    Googling suggests that this is an issue caused by kernel 3.x (which may also be caused by Xen, because all the hits I found have made reference to it), resulting in /dev/root not existing any longer. (And I've heard that /dev/root may be deprecated now?) The suggested workaround is to symlink /dev/root to the partition containing your actual root:

    ln -s /dev/xvda /dev/root

    However, it seems that this will not be permanent and would have to be repeated on every reboot. Obviously, this is a bad thing. It also seems like this is a bug in the quota tools itself which has not been reported here, since quotasys.c seems to suggest that /dev/root is hardcoded into the source code itself.

    I don't know enough about the quota system to patch the code myself, but I'm willing to apply any patches you can supply. Please let me know if I can be of any help, or if I've missed something that would cause this to work again. :D Thank you!

    - Sophie.

     
    Last edit: Sophie Hamilton 2013-05-13
  • Jan Kara
    Jan Kara
    2013-05-16

    So /dev/root in quotasys.c is used just in ancient kernels to check whether XFS (and thus XFS quota) is present in the kernel. It has nothing to do with the error message you see from quotacheck(8).

    You didn't mention what quota-tools version you are using but what I suspect is happening is that you have /etc/mtab file which contains /dev/root entry. If you fix that, the problem with quotacheck should be fixed as well.