Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Curious discrepancy

  • 17-09-2008 04:55PM
    #1
    Closed Accounts Posts: 12,807 ✭✭✭✭


    Just noticed this when I was checking disk usage at home.
    ~$ df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/md1              686G  144G  508G  23% /
    

    System Monitor agrees with it:
    screenshot1cd5.jpg

    But 507+143 is 650 - not 685.

    I've a nice little graphical app - Disk Usage Analyzer which tells a different story:
    screenshot2rr1.jpg

    An extra 40Gb free. And these figures add up.
    ~$ df -H
    Filesystem             Size   Used  Avail Use% Mounted on
    /dev/md1               737G   155G   545G  23% /
    

    So which is right and why? It's almost as if df gives the total space using 1Gb=1000Mb but free space as 1Gb=1024Mb. Surely not?


Comments

  • Registered Users, Registered Users 2 Posts: 354 ✭✭AndrewMc


    ext2 and ext3 filesystems typically reserve a small amount of the available space for the root user. Normally this amount is 5%, which is exactly the discrepancy you're seeing. Your first two tools are taking this into account, but the third isn't.

    From the mke2fs man page:
    -m reserved-blocks-percentage

    Specify the percentage of the filesystem blocks reserved for the super-user. This avoids fragmentation, and allows root-owned daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. The default percentage is 5%.

    If you're ever really, really stuck for that last bit of space, you can reduce this percentage (to zero, if you like) with tune2fs.


  • Closed Accounts Posts: 580 ✭✭✭karlr42


    Thanks for the info, I always vaguely wondered what was up, my free disk space always seems to be different depending on the app ;)


  • Closed Accounts Posts: 12,807 ✭✭✭✭Orion


    Thanks AndrewMc - didn't know that. So the space is free but reserved. Makes sense.


Advertisement