Results 1 to 3 of 3

Thread: [SOLVED] strange results using du -s -h

  1. #1
    Join Date
    Mar 2007
    Location
    Small village in the center of Italy
    Posts
    350
    Rep Power
    8

    Default [SOLVED] strange results using du -s -h

    i have a zimbra store of (circa) 40 G.

    i get different results using du -s -h on backup tree.
    here the problem:
    Code:
    [root@zimbra /opt/zimbra/backup ]#  du -s -h sessions
    53G     sessions
    so, for sure, under backup sessions is 53G size.
    let's see in detail:

    Code:
    [root@zimbra /opt/zimbra/backup ]# du -s -h sessions/full-2008052*/accounts
    60K     sessions/full-20080521.230014.067/accounts
    39G     sessions/full-20080523.230004.951/accounts
    25M     sessions/full-20080527.233455.855/accounts
    20M     sessions/full-20080527.233643.195/accounts
    29M     sessions/full-20080528.230018.251/accounts
    into full-20080523.230004.951 accounts dir contains 39 G

    but:
    Code:
    [root@zimbra /opt/zimbra/backup ]# du -s -h sessions/full-200805*/accounts
    40G     sessions/full-20080509.230006.464/accounts
    60K     sessions/full-20080514.230016.621/accounts
    56K     sessions/full-20080515.230046.925/accounts
    2.0G    sessions/full-20080516.230004.805/accounts
    60K     sessions/full-20080521.230014.067/accounts
    1.9G    sessions/full-20080523.230004.951/accounts
    25M     sessions/full-20080527.233455.855/accounts
    20M     sessions/full-20080527.233643.195/accounts
    29M     sessions/full-20080528.230018.251/accounts
    1.8G    sessions/full-20080530.230003.917/accounts
    surprisingly (for me) sessions/full-20080523.230004.951/accounts is only 1.9G, not 39G anymore

    and june?
    Code:
    [root@zimbra /opt/zimbra/backup ]#  du -s -h sessions/full-2008060*/accounts
    39G     sessions/full-20080606.230005.799/accounts
    ok, i have the full backup of 39G, isn't it?
    no...
    Code:
    [root@zimbra /opt/zimbra/backup ]#  du -s -h sessions/full*/accounts
    40G     sessions/full-20080509.230006.464/accounts
    60K     sessions/full-20080514.230016.621/accounts
    56K     sessions/full-20080515.230046.925/accounts
    2.0G    sessions/full-20080516.230004.805/accounts
    60K     sessions/full-20080521.230014.067/accounts
    1.9G    sessions/full-20080523.230004.951/accounts
    25M     sessions/full-20080527.233455.855/accounts
    20M     sessions/full-20080527.233643.195/accounts
    29M     sessions/full-20080528.230018.251/accounts
    1.8G    sessions/full-20080530.230003.917/accounts
    1.8G    sessions/full-20080606.230005.799/accounts
    sessions/full-20080606.230005.799/accounts is not 39G but 1.8G
    sadly....
    only sessions/full-20080509.230006.464/accounts seems to be full

    what i miss?

    tia

    -m
    Last edited by maumar; 06-10-2008 at 04:21 AM.

  2. #2
    Join Date
    May 2007
    Location
    Vancouver, Canada
    Posts
    75
    Rep Power
    8

    Default

    Zimbra Full backups use Unix hard links across copies of backups, so if multiple generations of backups all contain the same message, only one copy of the message is stored, and all of the more recent backups just link to that copy. In Unix, once all of the hardlinks to a file are removed, the file itself is finally removed from disk.

    Although I haven't dug into the source code for Linux's "du" command, as a first guess I'd say it's figuring out that the files are hard-linked across directories and is only associating the space used with the first directory it finds (which is why, as you narrow your search, the directory seems to change, but it's (almost) always the first directory)

  3. #3
    Join Date
    May 2007
    Posts
    71
    Rep Power
    8

    Default

    I had the same concern until Mike directed me to this thread.

    Apparently if you add a -l it'll tally sizes from hard links and make the du results look a bit more sane.
    Code:
    root@zimbra:/backups/zimbra/sessions# du -h -l --max-depth=1
    618M    ./full-20080613.040416.793
    40M     ./incr-20080613.060021.580
    609M    ./full-20080614.060020.592
    5.9M    ./incr-20080615.060027.047
    2.7M    ./incr-20080616.060025.701
    3.7M    ./incr-20080617.060025.441
    1.3M    ./incr-20080618.060017.466
    11M     ./incr-20080619.060027.055
    3.1M    ./incr-20080620.060023.485
    1.3G    .

Similar Threads

  1. Replies: 4
    Last Post: 10-14-2009, 12:56 PM
  2. strange problem with Sent folder
    By fchassaing in forum Users
    Replies: 0
    Last Post: 10-24-2007, 08:57 AM
  3. Search Results are Limited
    By moebis in forum Administrators
    Replies: 1
    Last Post: 11-15-2006, 08:54 AM
  4. AD GAL: successful, but empty, test results
    By tmadden in forum Administrators
    Replies: 0
    Last Post: 10-02-2006, 03:36 PM
  5. Strange asterisk zimlet problem
    By simonellistonball in forum Installation
    Replies: 2
    Last Post: 08-23-2006, 08:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •