size of folder on disk much larger than size reported by mail client.

Andreas Winkelmann ml at awinkelmann.de
Thu Sep 14 04:17:17 EDT 2006


Am Thursday 14 September 2006 09:27 schrieb Warren Howard:
> On 09/14/2006 12:02 PM, Andreas Winkelmann wrote:
> > Am Thursday 14 September 2006 07:56 schrieb Warren Howard:
> >> Hi,
> >>
> >> I've noticed that the size of the folders on disk can be much larger
> >> than the size reported by the mail client and I'm wondering why.
> >>
> >> I'm using Cyrus-imapd 2.2.12 and the mail client is Squirrelmail 1.4.8
> >> with the 1.5 version of the Folder Sizes plug-in.
> >>
> >> In Squirrelmail I can use the Folder Sizes plug-in to show that I have a
> >> folder with a "count" of 17120 and a size of 68 MB.  The folder is a
> >> shared folder that goes by the name "Postfix users".  On the mail server
> >> the corresponding disk location (to the best of my knowledge) for this
> >> folder is "/var/spool/imap/p/Internet\ Mailing\ Lists/Postfix\ users/".
> >>
> >> This directory has 17123 files in it, exactly 17120 (the count reported
> >> by the Folder Sizes plug-in) plus three additional files cyrus.cache,
> >> cyrus.header and cyrus.index.  The size of this directory with the three
> >> additional "cyrus" files is 120 MB - almost twice the size reported by
> >> the Folder Sizes plug-in for Squirrelmail.  Now cyrus.cache is 24 MB and
> >> cyrus.index is 1 MB (cyrus.header is tiny 165 bytes), subtracting these
> >> leaves me with mail message files that add up to 95 MB still 27 MB
> >> larger than what is reported by the Folder Sizes plug-in.
> >>
> >> I also checked the size of the "Postfix users" using cyradm (in case the
> >> Folder Sizes plug-in was wrong).
> >>
> >> localhost> info 'Internet Mailing Lists/Postfix users'
> >> {Internet Mailing Lists/Postfix users}:
> >>   lastupdate: 14-Sep-2006 10:35:00 +0530
> >>   partition: default
> >>   size: 72033301
> >>
> >> so why does cyradm and the Folder Sizes plug-in report a size of 68 MB
> >> where if I go and check on disk I see the sum of the message files on
> >> disk is closer to 95 MB?
> >
> > Please use:
> >
> > # du -bs --exclude="cyrus.*" /path/to/folder
>
> Sure,
>
> # du -bs --exclude="cyrus.*" /var/spool/imap/p/Internet\ Mailing\
> Lists/Postfix\ users/
> 72457932        /var/spool/imap/p/Internet Mailing Lists/Postfix users/
>
> Normally I use du with the -sh options
>
> du -sh --exclude="cyrus.*" /var/spool/imap/p/Internet\ Mailing\
> Lists/Postfix\ users/
> 95M     /var/spool/imap/p/Internet Mailing Lists/Postfix users/

$ dd if=/dev/zero of=1bytefile bs=1 count=1
1+0 records in
1+0 records out
1 byte (1 B) copied, 5.2e-05 seconds, 19.2 kB/s

$ du -hbs 1bytefile
1       1bytefile

"-b" Counts the Sizes on the basis of the real Bytes.

$ du -hs 1bytefile
4.0K    1bytefile

Without "-b" the "DiskUsage" (incl. Filesystem overhead) is shown.

Cyrus-Imapd counts the real Bytes. Filesystem Overhead is out of interest.

> That's a big difference in the reported size!  I've got no idea why that
> might be, and I guess it's now getting a bit off topic for this least,
> but thanks for the tip!

-- 
	Andreas


More information about the Info-cyrus mailing list