I implemented a ISPConfig3 config on Centos v6.x, but forgot to enable the user quota option. I did, however, install the quota module during the installation and configuration (# yum install quota).
Trying to enable the user quota options, I ran into several challenges;
- My environment is based on a hosted virtual machine, and not a physical machine described in the various manuals.
- Vague tips'n tricks regarding on how to enable user quota'
First you need to add the quota parameters to the fstab file located in /etc/fstab. My original file looked like this;
# vi /etc/fstab
/dev/xvda2 / ext3 defaults,errors=remount-ro,barrier=0 0 0
/dev/xvda1 none swap defaults 0 0
proc /proc proc defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
The quota parameters I needed to add were according to the ISPConfi3 manua;
usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0
You need to add these parameter on the drive that needs the quota settings. In my case it's xvda2. This results in the following /etc/fstab file:
/dev/xvda2 / ext3 defaults,errors=remount-ro,barrier=0,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 0 0
/dev/xvda1 none swap defaults 0 0
proc /proc proc defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
After that you need to remount the root in order to activate the quota settings.
# mount -o remount /
After that you need to check and activate the quota on the drive by issuing the following commands;
# quotacheck -avugm
# quotaon -avug
This resulted in an error that the root drive (/dev/root) couldn't be found.
quotacheck: WARNING - Quotafile //aquota.user was probably truncated. Cannot save quota settings...
quotacheck: WARNING - Quotafile //aquota.group was probably truncated. Cannot save quota settings...
quotaon: Cannot find quota file on / [/dev/root] to turn quotas on/off.
quotaon: Cannot find quota file on / [/dev/root] to turn quotas on/off.
This problem can be resolved by creating a symbolic link for /dev/root by issuing the following command;
# ln -s /dev/xvda2 /dev/root
Note that I used xvda2, which is the same drive as the one I editted in the /etc/fstab file.
This time the mount command did work.
You may need to remove the quota config files (aquota.*) in the root (/) of the filesystem by issuing the following command;
# rm /aquota.*
rm: remove regular empty file `aquota.group'? yes
rm: remove regular empty file `aquota.user'? yes
After this, everything should be working as advertised, so you can check the quota settings, and turn them on;
# quotacheck -avugm
quotacheck: Scanning /dev/root [/] done
quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
quotacheck: Checked 10432 directories and 88668 files
quotacheck: Old file not found.
quotacheck: Old file not found.
# quotaon -avug
/dev/root [/]: group quotas turned on
/dev/root [/]: user quotas turned on