Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 20th June 2008, 11:54
SupuS SupuS is offline
HowtoForge Supporter
 
Join Date: May 2006
Posts: 202
Thanks: 68
Thanked 14 Times in 12 Posts
Default quota problem - repquota does't match du -sh [SOLVED]

Hi All

With one web I have strange problem. It is almost over limit but du -sh returns different value:

User quota (web has this user only):

Code:
repquota -avug |grep zs25adminuser
zs25adminuser  --  996532       0       0           8856     0     0
zs25adminuser  --       0       0       0              0     0     0
Group quota:

Code:
repquota -avug |grep web25
web25     --  996532 1126400 1127424           8856     0     0
web25     --       0 1126400 1127424              0     0     0
su (as root):

Code:
du -sh /var/www/web25
693M    /var/www/web25
I tried search all files belongs to this user and group by:

Code:
find / -group web25
find / -user zs25adminuser
but all files are in /var/www/web25.

I cannot find any reason for this behavior.

Thanks for any suggestion
SupuS

Last edited by SupuS; 16th November 2008 at 12:17.
Reply With Quote
Sponsored Links
  #2  
Old 20th June 2008, 13:23
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,408
Thanks: 834
Thanked 5,496 Times in 4,326 Posts
Default

Are you really sure that all files are in /var/www/web25 ? Please double check that no files or folders are in /tmp and /var/spool/mail
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 20th June 2008, 13:30
SupuS SupuS is offline
HowtoForge Supporter
 
Join Date: May 2006
Posts: 202
Thanks: 68
Thanked 14 Times in 12 Posts
Default

Quote:
Originally Posted by till View Post
Are you really sure that all files are in /var/www/web25 ? Please double check that no files or folders are in /tmp and /var/spool/mail
Hi till

Yes I'am .. I checked tmp before post .. here is du of tmp and mail:

tmp:
Code:
du -sh /tmp/
58M     /tmp
mail (it is link /var/spool/mail -> ../mail)
Code:
du -sh /var/mail
740K    /var/mail
Whole tmp has 58M and no files owned by web25 or zs25*
Reply With Quote
  #4  
Old 9th October 2008, 11:01
SupuS SupuS is offline
HowtoForge Supporter
 
Join Date: May 2006
Posts: 202
Thanks: 68
Thanked 14 Times in 12 Posts
Default Same problem again

I found exactly same problem on another ispconfig server:

Code:
# repquota -avugs |grep web34
web34     --    949M   1000M   1001M          31676     0     0
web34     --       0   1000M   1001M              0     0     0
Code:
# du -sh /var/www/web34
835M    /var/www/web34
I found some empty files in /tmp and /var/mail but its deleting didn't help.

Any idea please?

SupuS
Reply With Quote
  #5  
Old 13th November 2008, 15:10
SupuS SupuS is offline
HowtoForge Supporter
 
Join Date: May 2006
Posts: 202
Thanks: 68
Thanked 14 Times in 12 Posts
Default

Again with same problem Now I found very interesting behaviour. Listing of my quota files says that quota.user has 111 GB.

Code:
# ls -lth /quota.*
-rw------- 1 root root 111G Nov 13 14:54 /quota.user
-rw------- 1 root root 2.5M Nov 13 14:54 /quota.group
-rw------- 1 root root 2.5M Jul 23 13:19 /quota.group.new
-rw------- 1 root root 2.5M Jul 23 13:19 /quota.user.new
But whole used disc space is 31 GB only:

Code:
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda4             127G   31G   90G  26% /
I cannot delete guota.user file. I get this error:

Code:
# rm -rf /quota.group
rm: cannot remove `/quota.group': Operation not permitted
quotacheck -avugm or quotacheck -avugmc doesn't help.

And after all .. running of repquota -avugs |grep webXX is really slow.

Any idea please?
Reply With Quote
  #6  
Old 14th November 2008, 21:54
SupuS SupuS is offline
HowtoForge Supporter
 
Join Date: May 2006
Posts: 202
Thanks: 68
Thanked 14 Times in 12 Posts
Default

So here is what I did to fix incredible big quota.user file:

Stop the quotas:

Code:
/etc/init.d/quota stop
or

Code:
quotaoff -a
Delete quota files.

Create new quota files, build new one and turning quota on:

Code:
touch /quota.user /quota.group
chmod 600 /quota.*
quotacheck -avugm
quotaon -avug
Now my quota files has proper size:

Code:
# ls -lth /quota.*
-rw------- 1 root root 2.5M Nov 14 21:35 /quota.group
-rw------- 1 root root 2.5M Nov 14 21:35 /quota.user
Unfortunately quotas of all users seems to be gone so I have to rebuild them by manual changing quota in ispconfig. May be is better way to rebuild it .. I don't know it

For now everything seems quite well. Even differences between quotacheck and du -sh changed:

Code:
# du -sh /var/www/web16
859M    /var/www/web16

# repquota -avugs |grep web16
web16     --    726M    800M    801M           5986     0     0
web16     --       0    800M    801M              0     0     0
.. not as I expected but better than before ..

may be somebody know what happend ..

SupuS
Reply With Quote
  #7  
Old 16th November 2008, 12:16
SupuS SupuS is offline
HowtoForge Supporter
 
Join Date: May 2006
Posts: 202
Thanks: 68
Thanked 14 Times in 12 Posts
Default

I finally solved problem with "unmatch quotas and du -su".

For reset quotas I used command:

Code:
quotacheck -avugmc
But it reseted all quotas for all webs. Now I created little script for update all quotas. Falko or Till check it please for bugs. It works for me.

Here is the script (part of writeconf.php)

PHP Code:
<?php

set_time_limit
(0);
// ĂberprĂźfung, ob parallel noch ein anderer ProzeĂ läuft
if(is_file("/root/ispconfig/.ispconfig_lock")){
  
clearstatcache();
  for(
$i=0;$i<120;$i++){ // max. 120 Sek. warten, dann weitermachen
    
if(is_file("/root/ispconfig/.ispconfig_lock")){
      
sleep(1);
      
clearstatcache();
    }
  }
}

@
touch("/root/ispconfig/.ispconfig_lock");

include(
"/root/ispconfig/scripts/lib/config.inc.php");
include(
"/root/ispconfig/scripts/lib/config.lib.php");
include(
"/root/ispconfig/scripts/lib/server.inc.php");

$isp_web = new isp_web;

echo 
"start\n";

/////////////// Web- u. Userdaten aus DB holen ////////////////
$w_ds $mod->db->queryAllRecords("SELECT * FROM isp_isp_web");
if(!empty(
$w_ds)){
  foreach(
$w_ds as $w_d){
    
$mod->system->data["isp_isp_web"][$w_d["doc_id"]] = $w_d;
  }
}

$u_ds $mod->db->queryAllRecords("SELECT * FROM isp_isp_user");
if(!empty(
$u_ds)){
  foreach(
$u_ds as $u_d){
    
$mod->system->data["isp_isp_user"][$u_d["doc_id"]] = $u_d;
  }
}

$mod->system->data["isp_server_ip"] = $mod->db->queryAllRecords("SELECT * FROM isp_server_ip WHERE server_id = '".$mod->system->server_id."' AND server_ip != ''");
////////////////////////////////////////////////////////////////

/* here I changed isp_isp_web.status = 'u' to isp_isp_web.status = '' so all webs will be updated */

$web_update $mod->db->queryAllRecords("SELECT * from isp_isp_web, isp_nodes where isp_isp_web.doc_id = isp_nodes.doc_id and isp_nodes.doctype_id = '".$isp_web->web_doctype_id."' and isp_isp_web.status = '' and isp_isp_web.server_id = '".$mod->system->server_id."' and isp_nodes.status = '1'");
$web_update_ssl_action 0;
if(!empty(
$web_update)){
  foreach(
$web_update as $web) {
    
$doc_id $web["doc_id"];
    
$doctype_id $web["doctype_id"];
    
$isp_web->web_update($doc_id,$doctype_id,$mod->system->server_id);
    echo 
"UPDATE: ".$doc_id."\n";
    if(
$web["ssl_action"] != ''$web_update_ssl_action += 1;
  }
}

// Webs und User endgĂźltig lĂśschen
$isp_web->web_user_clean();

echo 
"ende\n";

// lock-Datei lĂśschen
@unlink("/root/ispconfig/.ispconfig_lock");

?>
If somebody wants to use it please backup first and be carefully. It works for me but I didn't tested it very well yet.

For run this script simply save it and run by:

Code:
/root/ispconfig/php/php /path/to/new/script.php
Hope it helps somebody
Reply With Quote
The Following User Says Thank You to SupuS For This Useful Post:
till (16th November 2008)
  #8  
Old 16th November 2008, 12:22
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,408
Thanks: 834
Thanked 5,496 Times in 4,326 Posts
Default

An easier solution might have been, to execute this sql statement in the ispconfig DB:

update isp_isp_user set status = 'u' where status = '';

then change a setting in one of the users in the interface and click on save, so all users get updated.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 16th November 2008, 13:02
SupuS SupuS is offline
HowtoForge Supporter
 
Join Date: May 2006
Posts: 202
Thanks: 68
Thanked 14 Times in 12 Posts
 
Default

Quote:
Originally Posted by till View Post
An easier solution might have been, to execute this sql statement in the ispconfig DB:

update isp_isp_user set status = 'u' where status = '';

then change a setting in one of the users in the interface and click on save, so all users get updated.
I though about your solution before I created script too .. but it doesn't work for me .. probably my fault .. thanks
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
empty maildir /tmp after quota problem clamav Jorem General 5 20th June 2008 13:24
Virtual users... Ubuntu 8.04 spaceuser HOWTO-Related Questions 12 19th June 2008 08:04
Maildir Quota Problem grafzahl Installation/Configuration 2 7th March 2008 17:07
postfix + dovecot + postfixadmin - problem with quota kosta Server Operation 3 24th August 2007 22:08
Quota Problem with Procmail rafaelenrike Installation/Configuration 1 16th June 2006 02:32


All times are GMT +2. The time now is 13:24.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.