A Raspberry Pi can run for months as a media server, Home Assistant host, Pi-hole, Docker server, sensor gateway, or other always-on system. In many of these projects, storage problems develop slowly and are easy to miss until package updates fail, containers stop working, or the system reports No space left on device.
I put together this toolkit as a simple way to answer three questions:
How much space is left?
What is using it?
How can I catch the problem before the filesystem is full?
The tools are standard Linux utilities, so the same workflow works on headless Raspberry Pi systems over SSH as well as desktop installations.
Start with df
The quickest check is:
df -h
The -h option makes the values human-readable.
For the root filesystem only:
df -h /
This gives an immediate view of total capacity, used space, available space, and utilization percentage.
If I only need one quick health check on a Raspberry Pi, this is usually where I start.
Check the Actual Storage Devices
df shows mounted filesystems, but it does not clearly show how the physical drives and partitions are arranged.
For that I use:
lsblk -f
This is especially useful on newer Raspberry Pi setups that may combine:
- a microSD card
- USB SSD
- NVMe storage
- external USB drives
It shows the device, partition, filesystem type, and mount point in one place.
Find What Is Actually Consuming the Space
Once df shows that a filesystem is filling up, the next question is where the data is.
A quick check of the home directory is:
du -sh ~/*
For a broader look at the root filesystem:
sudo du -h --max-depth=1 / | sort -hr | head -n 15
This usually makes the largest directories obvious.
Common storage consumers on Raspberry Pi systems include:
- Docker images and volumes
- container logs
- downloaded media
- browser caches
- package caches
- system logs
- backups
- test data
Use ncdu for Interactive Exploration
For deeper investigation, ncdu is probably the tool I use most often.
Install it with:
sudo apt update sudo apt install ncdu
Then scan the root filesystem:
sudo ncdu -x /
The -x option keeps the scan on the current filesystem instead of following mounted external drives.
ncdu gives a navigable directory tree sorted by disk usage, which makes it much easier to drill down into large directories than repeatedly running du.
For headless Raspberry Pi systems, it is especially convenient because everything works over SSH.
Check System Logs
System logs can grow quietly when a service repeatedly produces warnings or errors.
To see journal usage:
journalctl --disk-usage
If persistent logging is enabled, I also check /var/log and the journal configuration when log growth looks abnormal.
The important lesson here is not to delete logs immediately. A rapidly growing log file often tells you that a service has another problem that should be fixed first.
Check Docker Separately
Docker deserves its own check because container storage can grow independently of the application data you normally see in your home directory.
Use:
docker system df
This reports disk usage from images, containers, local volumes, and build cache.
Before deleting Docker data, I always verify what is actually unused. Commands such as:
docker system prune
can be useful, but they should not be treated as routine commands without reviewing what will be removed.
Find Large Individual Files
If directories look normal but space is still disappearing, I search for unusually large files:
sudo find / -type f -size +100M -exec ls -lh {} \; 2>/dev/null
That can reveal forgotten backups, logs, downloads, database files, or application data that would otherwise be easy to miss.
Watch Disk Usage During a Heavy Task
For downloads, Docker builds, backups, or large file transfers:
watch -n 5 df -h /
This updates the root filesystem usage every five seconds.
It is a very simple tool,...
Read more »
Dmitry
Brenda Armour