can't get quotas to work (I've tried everyghing I found)

luiggig

Registered
Jul 4, 2011
4
0
51
Hi folks, hope you are doing well.

I've installed WHM in my brand new VPS a few days ago, and since then I'd been trying to get User Quota runinng but without success.
I've tried many many things that I've found in this this forum (and also googling) related to the errors I'm having, but nothing worked as fix. Maybe at some point this bunch of patches screwed it up, who knows...

Just some backgruond before describing the err:
- it's a XEN vm at VPSLink.com
- Centos 5.2-i386-default (this is what VPSLink says in it's panel)
And linux says: Linux version 2.6.18-238.9.1.el5xen
[email protected] [/usr/local/cpanel/logs]# cat /etc/*-release
CentOS release 5.6 (Final)
- WHM 11.30.0 (build 32)

- I've moved almost all acoounts from an "old" WHM reseller account by exporting a BKP and using Restore a Full Backup/cpmove file feature in new WHM (so this backup did import the Account Package settings with their respective quota settings as well)

- I've run the "Initial Quota Setup" script in WHM but I can't remember if it was after or before importing accounts, I can't tell exactly...

- The current List Accounts in WHM show "unlimited" in the Quota column for all of them. When trying to edit the Quota (has a 0 value), after saving, it keeps its zero value.



So, the problem when I run /scripts/fixquotas is :

Code:
[email protected] [/]# /scripts/fixquotas
Installing Default Quota Databases...../aquota.user..../quota.user..../var/tmp/aquota.user..../var/tmp/quota.user.....Done
Linux Quota Support
Quotas are now on
Warning : Your system does not have a separate filesystem for backups. This may cause performance degradation during the backup process.
Updating Quota Files......
        quotacheck: Scanning /dev/simfs [/] quotacheck: Checked 24822 directories and 185188 files
   [B][COLOR="red"]     quotacheck: Cannot rename new quotafile //aquota.user.new to name //aquota.user: Operation not permitted[/COLOR][/B]
        done

        quotacheck: Scanning /dev/simfs [/] quotacheck: Checked 24822 directories and 185189 files
        done

....Done
Reading package proasoci_small50
Resetting quota for assistan to 50 M
[COLOR="red"][B]edquota: Can't open quotafile //aquota.user: Permission denied[/B][/COLOR]
No filesystems with quota detected.

AND SO ON FOR EACH ACCOUNT
I'd been checking permissions and mounted devs as suggested, but all seems to be ok (as per seen in other posts)

contents of /etc/fstabs
Code:
[email protected] [/]# cat /etc/fstab

/dev/sda1               /                       ext3    defaults,usrquota,noatime 1 1
/dev/sda2               none                    swap    sw       0 0
none                    /dev/pts                devpts  gid=5,mode=620 0 0
none                    /dev/shm                tmpfs   defaults 0 0
none                    /proc                   proc    defaults 0 0
none                    /sys                    sysfs   defaults 0 0

/usr/tmpDSK             /tmp                    ext3    defaults,noauto        0 0
/tmp             /var/tmp                    ext3    defaults,usrquota,bind,noauto        0 0
output for mount
Code:
/dev/simfs on / type reiserfs (rw,usrquota,grpquota)
/dev on /dev type tmpfs (rw)
/proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
none on /selinux type selinuxfs (rw)
/proc/bus/usb on /proc/bus/usb type usbfs (rw)
none on /dev/pts type devpts (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/loop0 on /tmp type ext3 (rw,nosuid,noexec,data=ordered)
/dev/loop0 on /var/tmp type ext3 (rw,nosuid,noexec,data=ordered)
permissions and lsattr on /*quota* files
Code:
[email protected] [/]# ls -all *quota*
-rw------- 1 root root   13312 Jul  4 22:04 aquota.group
-rwxr--r-- 1 root root   14336 Jul  4 22:02 aquota.user*
-rw------- 1 root root   14336 Jul  4 22:03 aquota.user.new
-rw------- 1 root root 1024320 Jul  4 22:04 quota.group
-rwxr--r-- 1 root root 2097152 Jul  4 22:04 quota.user*

[email protected] [/]# lsattr /*quota*
------------- /aquota.group
------------- /aquota.user
------------- /aquota.user.new
------------- /quota.group
------------- /quota.user
contents of /etc/quota.conf
Code:
[email protected] [/]# cat /etc/quota.conf
proasoci=150
menosinf=70
restore=50
sklr=1024
assistan=50
cpanelphpmyadmin=0
cpanelhorde=0
cpanelroundcube=0
named=0
luisg=70
xviicong=150
cpaneleximfilter=0
ita=250
ramirez=70
nueba=125
cpanel=0
cpanelphppgadmin=0
luiggig=70
bikinis=50
permissions for /etc/quota.conf
Code:
[email protected] [/]# ls -all /etc/quota.conf
-rw------- 1 root root 237 Jul  4 22:04 /etc/quota.conf
[email protected] [/]# lsattr /etc/quota.conf
------------- /etc/quota.conf

Then I've read some posts (here and in other forums / blogs) where re-running the Initial Quota made the trick.. well. Nor for me.. This is the output:
Code:
[email protected] [/]# /scripts/initquotas
Linux Quota Support
Quotas are now on
Warning : Your system does not have a separate filesystem for backups. This may cause performance degradation during the backup process.
Updating Quota Files......
        quotacheck: Scanning /dev/simfs [/] quotacheck: Checked 24824 directories and 185197 files
[B][COLOR="red"]        quotacheck: Can't create new quotafile //aquota.user.new: File exists
        quotacheck: Cannot initialize IO on new quotafile: File exists[/COLOR][/B]
        done

        quotacheck: Scanning /dev/simfs [/] quotacheck: Checked 24824 directories and 185197 files
        done

....Done
As the error says "file exists", I just removed the aquota.user.new file and tried again: no success...
Code:
[email protected] [/]# rm /aquota.user.new
rm: remove regular file `/aquota.user.new'? y
[email protected] [/]# /scripts/initquotas
Linux Quota Support
Quotas are now on
Warning : Your system does not have a separate filesystem for backups. This may cause performance degradation during the backup process.
Updating Quota Files......
        quotacheck: Scanning /dev/simfs [/] quotacheck: Checked 24824 directories and 185194 files
    [COLOR="red"][B]    quotacheck: Cannot rename new quotafile //aquota.user.new to name //aquota.user: Operation not permitted[/B][/COLOR]
        done

        quotacheck: Scanning /dev/simfs [/] quotacheck: Checked 24824 directories and 185195 files
        done

....Done
I guess it can't rename to aquota.user because it's in use... is any other way to do this?



I've also tried things such as the following, with no succes...

Code:
[email protected] [/]# quotaoff -a
quotaoff: quotactl on /dev/simfs [/]: No such device
quotaoff: quotactl on /dev/simfs [/]: No such device
[email protected] [/]# quotaon -a
quotaon: using //aquota.group on /dev/simfs [/]: No such device
quotaon: using //aquota.user on /dev/simfs [/]: No such device
[email protected] [/]#


more info: output for repquota -a
Code:
[email protected] [/]# repquota -a
*** Report for user quotas on device /dev/simfs
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      -- 4324844       0       0         174430     0     0
bin       --   30936       0       0            252     0     0
nobody    --   15188       0       0             69     0     0
mailnull  --     892       0       0            117     0     0
rpm       --   20660       0       0             16     0     0
named     --     164       0       0             28     0     0
davfs2    --    1892       0       0            131     0     0
cpanel    --      84       0       0             22     0     0
cpanelhorde --     452       0       0              8     0     0
cpanelphpmyadmin --      12       0       0              4     0     0
cpanelphppgadmin --      12       0       0              4     0     0
cpanelroundcube --      52       0       0              8     0     0
mailman   --   38952       0       0           2282     0     0
dovecot   --       4       0       0              1     0     0
mysql     --   29812       0       0            612     0     0
cpaneleximfilter --       8       0       0              3     0     0
luiggig   --   22728       0       0            726     0     0
bikinis   --   46896       0       0            815     0     0
ramirez   --   53584       0       0           1432     0     0
sklr      --  683900       0       0            725     0     0
ita       --  115640       0       0           1807     0     0
menosinf  --   38964       0       0           5239     0     0
nueba     --  104692       0       0           2518     0     0
xviicong  --    5372       0       0            451     0     0
luisg     --   47856       0       0           1509     0     0
proasoci  --  140832       0       0           1663     0     0
restore   --     328       0       0             80     0     0
assistan  --   21520       0       0           1252     0     0
#200      --    1104       0       0             63     0     0
#400      --      92       0       0             11     0     0
#501      --   12600       0       0            825     0     0
#502      --       0       0       0              1     0     0
#504      --     328       0       0             81     0     0
#1000     --    8192       0       0            922     0     0
#508      --       0       0       0              1     0     0
#50138    --   43044       0       0           3948     0     0
#12475    --     228       0       0             27     0     0
#55       --    1984       0       0             74     0     0
#1013     --   61344       0       0           3485     0     0
#65535    --      20       0       0              5     0     0
another one
Code:
[email protected] [/]# rm -f /boot/aquota.user
[email protected] [/]# rm -f /backup/aquota.user
[email protected] [/]# rm -f /backup/aquota.user.new
[email protected] [/]# /scripts/initquotas
Linux Quota Support
Quotas are now on
Warning : Your system does not have a separate filesystem for backups. This may cause performance degradation during the backup process.
Updating Quota Files......
        quotacheck: Scanning /dev/simfs [/] quotacheck: Checked 24824 directories and 185200 files
        quotacheck: Can't create new quotafile //aquota.user.new: File exists
        quotacheck: Cannot initialize IO on new quotafile: File exists
        done

        quotacheck: Scanning /dev/simfs [/] quotacheck: Checked 24824 directories and 185200 files
        done

....Done
And more useless stuff, trying to delete aquota* files, trying to reinstall quotas.. nothing seems to work..

What really worries me while trying to quotaon or quotaoff is this:

quotaoff: quotactl on /dev/simfs [/]: No such device
quotaoff: quotactl on /dev/simfs [/]: No such device

WTF? I've searched a lot but can't make it. I'm not a linux close friend too...

Hope anyone can help, I'm kinda hopeless. Thanks in advance for reading up to here!!
 

luiggig

Registered
Jul 4, 2011
4
0
51
Well, I found some way to fix it. Not the safest one, but it worked.

There are the steps:
- stop WHM ( /etc/init.d/cpanel stop )
- uninstall quota (yum erase quota)
- reboot (System works fine, no crashes no problems. I've checked the boot log: Starting vzquota: /etc/rc3.d/S10vzquota: line 10: quotaon: command not found
[FAILED]
but nothing else weird or suspicious, cPanel started ok)
- rename ALL current quota files for .bak (just in case!) This is the step I tried before (as seen in original post) but without succes because some denial.
- install quota (yum install quota)
- run /scripts/initquota
- run /scripts/resetquota

Then I logged in to WHM and when browsing accounts... magic!! all is working now (so far.. I hope forever!!)

Remarks: accidentaly I forgot to remove the "old" /etc/quota.conf file (or mv for backup), but neither the init nor the reset scripts raised any related error... And quotas are working just as expected (as per Packages definitions)

Hope this will be useful for someone else.

Thanks anyway. Cheers