Understanding Disk Usage Difference in Ubuntu/Linux (df -h)

Understanding Disk Usage Difference in Ubuntu/Linux (df -h)

Understanding Disk Usage Difference in Ubuntu/Linux (df -h)

Overview

When checking disk usage in Ubuntu/Linux using the df -h command, administrators may notice that the total disk space does not exactly match the sum of used and available space.

Example:

df -h

Output:

Filesystem      Size  Used Avail Use% Mounted on
/dev/root 29G 15G 15G 50% /

At first glance:

15G Used + 15G Available = 30G

However, the total disk size displayed is only 29G.

Cause

This behavior is normal in Linux filesystems and occurs due to:

  • Filesystem reserved blocks
  • Filesystem metadata and journaling
  • Human-readable rounding by df -h

Linux filesystems such as EXT4 reserve a percentage of disk space (typically 5%) for:

  • Root/system processes
  • Filesystem recovery
  • Preventing complete disk exhaustion

Verification Steps

Check Exact Disk Usage in MB

Run:

df -BM

Example:

Filesystem     1M-blocks  Used Available Use%
/dev/root 30720M 14890M 14830M 50%

This shows the exact allocation without human-readable rounding.

Check Exact Usage in Bytes

Run:

df -B1

This displays precise byte-level usage information.

Check Reserved Block Information

Run:

sudo tune2fs -l /dev/root | grep "Reserved block"

Example output:

Reserved block count:     380000
Reserved blocks uid: 0
Reserved blocks gid: 0

Check Reserved Block Percentage

Run:

sudo tune2fs -l /dev/root | grep "Reserved block percentage"

Typically, EXT4 reserves approximately 5% of total disk space.

    • Related Articles

    • Bulk OS Installation using PXE Boot and FOG Project

      Performing bulk OS installations using PXE (Preboot eXecution Environment) network boot is a convenient and efficient method for deploying operating systems across multiple computers simultaneously. For performing bulk OS, we boot over PXE. The FOG ...
    • Sophos SSL VPN Profile configuration different office locations

      Follow the steps to configure and download the different office site's SSL VPN profile If working remotely, a VPN connection is required to access the different Sites' network resources. Download the required VPN Profile URLs for different office ...
    • How to request an additional requirement in our software applications

      What is Enhancement request Enhancement Process is the process of implementing a request by employee to add or amend the functionality beyond the available functions in our Software Applications. This request is typically made by employees or ...