disk quota error

shin0bi

Verified User
Joined
Feb 26, 2004
Messages
24
Hi all,


I have a user who's disk quota isn't correct. The quota is currently reporting 835.9 / 250. However when I run 'qouta username' the machine reports 355776 k used. I'm unsure as to what may be causing the problem.



Thanks in advance. :)
 
Hello,

Try running this:
Code:
echo "action=tally&value=all" >> /usr/local/directadmin/data/task.queue
So that DA recounts everything.

John
 
Thanks John,



I've tried that, however the quota count for the user is still incorrect. According to DA total web space used is 118.2 MB and disk space used is 374.7 MB, however when manually checking mail, web space, database usage, etc. for the user I come up with a total usage of 159MB. In addition when I run quota -v username, I get

Filesystem blocks quota limit grace files quota limit grace
/dev/sda7 0 0 0 0 0 0
/dev/sda8 355776* 256000 256000 19364 0 0


I'm a little confused, does DA also calculate other directories associated with each user besides the ones I listed.


Thanks,
 
du -sm /home/customer /home/mysql/customer_db
/var/spool/mail/customer
/var/spool/virtual/customer.com
/etc/virtual/customer.com


These values are returned:

129 /home/customer
16 /home/mysql/customer_db
0 /var/spool/mail/customer
14 /var/spool/virtual/customer.com
1 /etc/virtual/customer.com


Also here is what DA is reporting

cat /usr/local/directadmin/data/users/customer/user.usage
bandwidth=18.4
domainptr=0
ftp=3
mysql=1
nemailf=-1
nemailml=0
nemailr=0
nemails=6
nsubdomains=0
quota=374.8
vdomains=1

NOTE: quota does not match actual du output. Why the descrepency?



Again, Thanks in advance. :)
 
Last edited:
Hello,

If the system quotas are returning 355 meg of usage, then somewhere on that partition, the users' file should be visible.. If you quota partition is /, the all files on that partition owned by the user will be added. Files owned by the user could exist in:

/home/username
/home/tmp
/tmp
/var/spool/mail/username
/var/spool/virtual/*


so.. those are where the quota files should be found.. Since quota is returning the large value, we can discard the possibility of the databases or any other files not owned by the use using the space.

Now, sometime the aquota.user file gets corrupted and needs to be repaired.

Redhat:
/sbin/quotaoff -a
/sbin/quotacheck -avugmf
/sbin/quotaon -a

FreeBSD:
/usr/sbin/quotaoff -a
/sbin/quotacheck -avug
/usr/sbin/quotaon -a

John
 
Oh. That's very common problem :)

You can list all files owned by that user with command:

Code:
find / -user <uid>

Maybe some of those files have that user's UID by mistake.(Probably they was extracted by you from some .tar archive with "preserve attributes" option.)

So find and chown them.
 
Thanks everyone, there were a bunch of files owned by the user which contributed to the usage. :)
 
Also can you tally/recalculate quota for a specific user using echo "action=tally&value=all" >> /usr/local/directadmin/data/task.queue? Can I change the value=all variable to use the username or uid?


Thanks again,
 
Code:
echo 'action=tally&value={username}&type=user' >> /usr/local/directadmin/data/task.queue
where {username} is the user's name :)
 
Back
Top