Directory size 135MB, but empty

Discussion in 'Installation/Configuration' started by webhunter, Jul 5, 2016.

  1. webhunter

    webhunter New Member HowtoForge Supporter

    Hi!
    I backed up my e-mails from another server. E-mail count:903542, size > 2.2GB.
    After I've removed all the unwanted e-mails from this directory, I copied the rest to my e-mail dir.
    Now, the folder with my backed up e-mails is empty but directory size of /cur is still 118MB and /new 135MB.
    But both directories seems to be empty. Output of
    Code:
    ls -l <path-to-maildir>
    is
    Code:
    drwx------ 2 ntp    31 123453440 Jul  5 08:24 cur
    -rw-r--r-- 1 ntp    31        31 Mai 16 00:19 maildirsize
    drwx------ 2 ntp    31 141328384 Jul  5 14:35 new
    drwx------ 2 ntp    31      4096 Mai 16 00:19 tmp
    The output of
    Code:
    du -h --max-depth=1 <path-to-maildir>
    returns
    Code:
    135M    /<path-to-maildir>/new
    4,0K    /<path-to-maildir>/tmp
    118M    /<path-to-maildir>/cur
    
    The first command executed at the e.g. dir "/cur", returns "total 0".
    Why is that and how can I fix that? Is it possible, that there are any files within the directories left which I can't see (I don't think so)?

    Thanks!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    run:

    ls -la

    instead of

    ls -l

    to see the maildir folders. These folders start with a dot and therefore are hidden to ls -l but not ls -la
     
  3. webhunter

    webhunter New Member HowtoForge Supporter

    Hi Till,
    thnx for your reply.

    It's not about the hidden maildir folders. It's about the stated size and their content.
    An empty dir normally has size of approx. 4K. My e-mail folder "/cur" - as an example - doesn't have any e-mails in it but has a size of 125MB!
    But: Your given command executed at the maildir "/cur", brought up this:

    Code:
    ls -la
    total 120568
    drwx------ 2 ntp 31 123453440 Jul  5 08:24 .
    drwx------ 9 ntp 31      4096 Mai 16 00:19 ..
    
    So, there are 120568 e-mails still left in this directory which I can't see.
    Why is that and how can I fix that? Never ran into this before...
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, that's really strange indeed. Maybe you should do a filesystem check to see if there are any errors on filesystem level.
     

Share This Page