The following investigation has caused us to wonder the following:
We have a customer on a server, which has a du that looks like this:
	
		
This would appear that all disk usage tallies up to ~247MB. In the DirectAdmin web interface, the usage for this customer shows:
	
		
Which makes sense on the surface. However, neither /home/customer/domains/customer_domain/stats or /home/customer/domains/customer_domain/logs are customer owned (root owned), so they would need to be removed from our estimate, I would think:
	
		
Further, there are root owned IMAP files which attribute a massive chunk of the du as well:
	
		
Using a find & tally command I wrote, I was able to discover that /home/customer only has ~116MB of actual customer owned files. See handy dandy oneliner:
	
		
 (Note that the customer doesn't have very many files, so this works)
Naturally, one could also restrict find to only files, which would remove all the 4k directory counts as well, which would further lower the tally.
As a trouble shooting step, we tried setting the IMAP directories to customer ownership & re ran the tally, but that only skewed the disk usage even higher!
It is also worth mentioning that the email tally appears to be correct with or without the ownership of the IMAP files set (doesn't change, and appears to roughly match a du of /home/customer/imap, /home/customer/mail, /var/spool/mail/customer & /var/spool/virtual/customer/domains).
So, my questions, again, are:
				
			- How does DirectAdmin tally customer disk usage quotas?
 - Additionally, how does DirectAdmin tally the email disk usage?
 - Should customer IMAP directories be owned by root??
 
We have a customer on a server, which has a du that looks like this:
		Code:
	
	[root@server:~]# du -sm /home/customer /home/mysql/customer_db \
/var/spool/{mail/customer,virtual/customer_domains}
201     /home/customer
34      /home/mysql/customer_db
1       /var/spool/mail/customer
0       /var/spool/virtual/customer_domain_1
8       /var/spool/virtual/customer_domain_2
	This would appear that all disk usage tallies up to ~247MB. In the DirectAdmin web interface, the usage for this customer shows:
		Code:
	
	Total Disk Usage (meg)	247.6
  Email Disk Usage	93.2 Mb	
  Database Disk Usage	32.1 Mb
	Which makes sense on the surface. However, neither /home/customer/domains/customer_domain/stats or /home/customer/domains/customer_domain/logs are customer owned (root owned), so they would need to be removed from our estimate, I would think:
		Code:
	
	[root@server:~]# du -sm /home/customer/domains/customer_domain/{stats,logs}
3       /home/customer/domains/customer_domain/stats
17      /home/customer/domains/customer_domain/logs
	Further, there are root owned IMAP files which attribute a massive chunk of the du as well:
		Code:
	
	[root@server:/home/customer/imap/customer_domain/user/mail]# ll
total 86260
-rw-rw----    1 customer mail          515 Mar 17  2004 Drafts
-rw-------    1 root     root          510 Mar 24  2004 INBOX.Drafts
-rw-------    1 root     root      1352035 Jun 13 09:18 INBOX.Sent
-rw-------    1 root     root     59751314 Jun 23 09:42 INBOX.Trash
-rw-rw----    1 customer mail        27653 Mar 17  2004 Sent
-rw-rw----    1 customer mail     27080691 Mar 17  2004 Trash
	Using a find & tally command I wrote, I was able to discover that /home/customer only has ~116MB of actual customer owned files. See handy dandy oneliner:
		Code:
	
	t=0; for i in `find /home/customer -uid customer_uid -exec ls -ld {} \;|awk '{print $5}'`; \
do t=$[$t+i]; done; echo $t
	Naturally, one could also restrict find to only files, which would remove all the 4k directory counts as well, which would further lower the tally.
As a trouble shooting step, we tried setting the IMAP directories to customer ownership & re ran the tally, but that only skewed the disk usage even higher!
It is also worth mentioning that the email tally appears to be correct with or without the ownership of the IMAP files set (doesn't change, and appears to roughly match a du of /home/customer/imap, /home/customer/mail, /var/spool/mail/customer & /var/spool/virtual/customer/domains).
So, my questions, again, are:
- How does DirectAdmin tally customer disk usage quotas?
 - Additionally, how does DirectAdmin tally the email disk usage?
 - Should customer IMAP directories be owned by root??
 
			
				Last edited: