Linux disk full: diagnose and reclaim space

A problem-fix walkthrough for a full Linux disk: find the culprit filesystem, remove space hogs, sweep caches, and verify the space came back.

LinuxFilessystemdisktroubleshootinglsofDiagnosticsMedium risk
Run a human-readable filesystem report first to see which mount is full and how bad it is.

What this covers

When a Linux box runs out of disk space, symptoms pile up fast: failed writes, apps refusing to start, log entries about "No space left on device". This guide walks through the order that works — confirm which filesystem is full, hunt down the biggest consumers, clean the standard cache and log locations, and verify the space is actually released.

Symptom

?Commands fail with "No space left on device", applications crash or refuse to save files, or df shows one mount at 95–100% usage.

Find out which filesystem is full

Start by confirming the problem and locating it. Run a human-readable filesystem report and look at the Use% column. If one mount (often /) shows 95% or more, that filesystem is your target. Knowing which mount is full tells you where to focus the cleanup steps that follow.

Show total, used, and available space plus usage percentage for every mounted filesystem in human-readable units.

Command
$ df -h

Check for deleted files still held open

If df reports the disk nearly full but du adds up to much less, processes are likely holding deleted files open. This lists such files together with the process that owns them — restart or signal that process and the space is released immediately. Skip this if df and du agree.

When df says full but du disagrees, open-but-deleted files are the usual culprit; lsof +L1 lists them with the process holding each.

Command
$ sudo lsof +L1

Hunt down the biggest space hogs

Scan the filesystem that df flagged and browse the tree by size. Directories and files are ranked from largest to smallest, so you can drill into caches, old downloads, or log directories and delete what you don't need right from the interface. Work through the top entries and re-check the remaining total as you go.

ncdu scans a directory tree, then lets you browse sizes, navigate, and delete space hogs with one keypress.

Command
$ ncdu /

Sweep caches and logs system-wide

For space that manual browsing misses, bleachbit knows the standard cache, log, and temporary locations for the system and common applications. Preview the available cleaners first, then wipe the ones you select. Use the system-wide mode with sudo for caches owned by root. This works well as a finishing pass after ncdu.

Preview available cleaners, then wipe caches, logs and activity traces from the terminal — as user or system-wide with sudo.

Command
$ bleachbit --list | head && bleachbit --clean system.tmp firefox.cache

Confirm the space came back

Run the filesystem report again and compare Use% against your starting numbers. The filesystem you cleaned should now show a noticeably lower percentage. If it is still high, go back to the diagnosis steps — open-but-deleted files are the most common reason a cleanup doesn't show up in df.

Show total, used, and available space plus usage percentage for every mounted filesystem in human-readable units.

Command
$ df -h
!Deleting files to free space is irreversible — preview before wiping with automated cleaners, and prefer removing obvious junk (caches, logs, old downloads) over unknown files.

How to confirm it worked

Re-run the filesystem report and confirm the Use% on the affected mount has dropped well below the level that triggered the problem.

Sources

  • df(1) — report file system disk space usage
    man7.org · technical · 2026-09-17
    Evidence: The df man page documents '-h' / '--human-readable' as printing sizes in powers of 1024 with human-readable units like G.
  • lsof(8) - Linux manual page
    Ubuntu Manpages · technical · 2026-09-17
    Evidence: The +L1 option selects files with a link count less than one, i.e. open files that have been unlinked (deleted).
  • ncdu(1) - Linux manual page
    Ubuntu Manpages · technical · 2026-09-17
    Evidence: ncdu is a curses-based disk usage analyzer; pressing d within the browser deletes the selected file or directory, and -o exports the scan.
  • BleachBit Command Line Interface — Official Documentation
    BleachBit · vendor-doc · 2026-09-17
    Evidence: Documents bleachbit --list to show available cleaners and --clean cleaner.option to wipe the selected items headlessly.
  • BleachBit — README
    BleachBit project (GitHub) · vendor-doc · 2026-09-17
    Evidence: Official readme: BleachBit frees disk space and guards privacy by cleaning caches, cookies, log files and shredding files.

Last verified: 2026-09-21

Related guides