Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

/etc/quota.conf empty

Discussion in 'General Discussion' started by blargman, Nov 1, 2007.

  1. blargman

    blargman Well-Known Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    56
    All the quotas are unlimited. I've tried fixquotas/iniquotas. I found a thread on how to do resetquotas, but its failing as the /etc/quota.conf is empty.

    How can i repopulate quota.conf? I tried rpm -e quota and reinstalling.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Are quotas enabled for the drive on which accounts exist?
     
  3. blargman

    blargman Well-Known Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    56
    yes sir, I tried quotaon and quotaoff as it was suggested in a forum post i found.
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,470
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    If the quotas are working but you simply have an empty /etc/quota.conf file, then I wrote the following script a while ago to repopulate it with the Package defaults so save you having to reassign them all by hand:
    Code:
    #!/usr/bin/perl
    opendir (DIR, "/var/cpanel/packages");
    while (my $file = readdir (DIR)) {
    	if ($file !~ /^\./) {
    		open (IN, "</var/cpanel/packages/$file");
    		my @data = <IN>;
    		close (IN);
    		chomp @data;
    
    		foreach my $line (@data) {
    			if ($line =~ /^QUOTA=(.*)$/) {
    				$package{$file} = $1;
    				last;
    			}
    		}
    	}
    }
    closedir (DIR);
    $package{undefined} = 0;
    
    opendir (DIR, "/var/cpanel/users");
    while (my $user = readdir (DIR)) {
    	if ($user !~ /^\./) {
    		open (IN, "</var/cpanel/users/$user");
    		my @data = <IN>;
    		close (IN);
    		chomp @data;
    
    		foreach my $line (@data) {
    			if ($line =~ /^PLAN=(.*)$/) {
    				open (OUT, ">>/etc/quota.conf");
    				print OUT "$user=$package{$1}\n";
    				close (OUT);
    				last;
    			}
    		}
    	}
    }
    closedir (DIR);
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. blargman

    blargman Well-Known Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    56
    awesome, thanks a ton chirpy, worked perfectly. ran fixquotas afterwards and everything is back to normal!
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice