LinuxJunior

No space left on device

A full filesystem breaks writes, logs and installs. Check space and inodes with df, find the big directory with du, and trim the systemd journal.

What you see

  • No space left on device when writing a file, installing a package or starting a service

What it means

A filesystem can run out of two things: space and inodes. Inodes are the records the filesystem keeps for each file. A disk full of millions of tiny files can be out of inodes while df -h still shows free space.

How to confirm the cause

  1. 1
    Check space per filesystem
    df -h

    Find the filesystem at or near 100% use.

  2. 2
    Check inodes per filesystem
    df -i

    -i (--inodes) lists inode information instead of block usage. High IUse% with free space means too many files.

  3. 3
    Find the big directory, staying on one filesystem
    du -xh --max-depth=1 /var

    -x stays on one filesystem, -h is human readable, --max-depth=1 shows one level. Repeat on the largest directory to drill down.

  4. 4
    See how much the systemd journal uses
    journalctl --disk-usage

    Shows the total disk use of archived and active journal files.

Causes and fixes

  • Logs or the journal grew

    HOW TO TELL
    /var/log or the journal is the biggest directory.
    FIX
    Shrink archived journal files to a size. This removes the oldest archived files and does not touch active ones.
    sudo journalctl --vacuum-size=500M
  • Out of inodes

    HOW TO TELL
    df -i shows IUse% at or near 100%.
    FIX
    Find the directory with the most small files and remove what is safe to remove, such as old cache or session files. Freeing bytes does not help if the count of files stays the same.
  • Unused container data

    HOW TO TELL
    Docker is installed and /var/lib/docker is large.
    FIX
    See the Docker disk space runbook for prune commands and what each one can delete.

How to stop it coming back

  • Alert on disk space and on inode use, not only on space.
  • Set a journal size limit and log rotation.
  • Put data directories on their own filesystem so one full volume does not stop the OS.

Keep going

Sources

Linux man-pages (man7.org) and the systemd manual (freedesktop.org), read 18 Nov 2026. Command options were checked against those pages.

Search

Search cheat sheets and projects