Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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