Quotas problem on CentOS 6.2 64bit

I asked Linode support for help, but was told to try the forum instead. :)

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: http://help.directadmin.com/item.php?id=42

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

I've had the exact same issue with cPanel on Linode - quotas weren't set.

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

Thanks. However the adding the needed to etc/fstab did not work because there was other problem. The major problem was that /dev/root did not exist on this Linode distribution of CentOS 6.0 64bit. This is how I solved the problem:

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

However I now discovered that after doing:

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 …

From the looks of things, /dev/root seems to be deprecated (based on 1 and 2). From a quick survey, I have it on my Ubuntu 10.04 workstation and Linode, but not on my Ubuntu 11.10 netbook.

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.

I'm having exactly the same issue. It seems to be a bug that affects Centos 6.x on Xen from my searches. The only problem with creating the /dev/root link in /etc/rc.local is that the link needs to exist before this code in /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

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!

Got the same problem in centos 32 bits.

Upgrading my Linode to Ubuntu 14.04LTS at the moment, and I have the same issue. The symlink fixed it.

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

Also on Ubuntu 14.04. I needed to do the following :

# /etc/rc.local

ln -s /dev/xvda /dev/root
/etc/init.d/quota restart

exit 0

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!

@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 Crazy Bulk supplements with /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.

Hi Net-burst, where do I put that code for it to work? I inserted it but nothing happens.

You enter that line on the command line as user root. What it does is to write

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.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct