Eirik Rye
2021-May-20 13:18 UTC
Dovecot v2.3.13 reporting (very) incorrect vsize for some maildir folders
> On 20 May 2021, at 14:59, Timo Sirainen <timo at sirainen.com> wrote: > > Well, next step could be to compare individual mail sizes. It would require writing some kind of a script to do the comparison though.Hello again, Apologies, I think dovecot is innocent in all of this. I noticed that `ls -s` reported a completely different size to `du`, but similar to what dovecot reports: # ls -s | head -1 total 14099016 # du 7050436 . I assume there are some sparseness or block size related shenanigans going on here instead, causing differences in reported physical usage by `du` (syscall `newfstatat()`) compared to `ls` (syscall `lstat()`) and dovecot. The filesystem quota system in Linux, which is what we're migrating from, apparently uses the same calculation method as `du`, which adds to the confusion. - Eirik
Eirik Rye
2021-May-20 13:39 UTC
Dovecot v2.3.13 reporting (very) incorrect vsize for some maildir folders
> On 20 May 2021, at 15:18, Eirik Rye <rye at trojka.no> wrote: > > I assume there are some sparseness or block size related shenanigans going on here instead, causing differences in reported physical usage by `du` (syscall `newfstatat()`) compared to `ls` (syscall `lstat()`) and dovecot. > > The filesystem quota system in Linux, which is what we're migrating from, apparently uses the same calculation method as `du`, which adds to the confusion.Oh, a lot of messages in these folders appear to be hardlinks to the same inodes (duplicates). Dovecot's vsize-calculation doesn't care that messages are referencing the same inodes, but `du` and Linux' quota calculation obviously does. That explains everything, then. Apologies again for the bother. - Eirik
Joseph Tam
2021-May-21 22:20 UTC
Dovecot v2.3.13 reporting (very) incorrect vsize for some maildir folders
On Thu, 20 May 2021, Eirik Rye wrote:> I noticed that `ls -s` reported a completely different size to `du`, but similar to what dovecot reports: > > # ls -s | head -1 > total 14099016 > # du > 7050436 . > > I assume there are some sparseness or block size related shenanigans > going on here instead, causing differences in reported physical usage > by `du` (syscall `newfstatat()`) compared to `ls` (syscall `lstat()`) > and dovecot.You'll note the ratio between then is almost exactly 2. Some utilities report space usage in 512-byte block, some in K. I would hazard a guess that 'ls -s' is reporting in blocks, not K. The man page for my OS 's'ls' states exactly that -- counts are in blocks. Joseph Tam <jtam.home at gmail.com>