How to Check Disk Space and Inodes on a Linux VPS
Updated · Autdo Cloud
Check both filesystem capacity and inode usage when a Linux VPS reports that storage is full. A filesystem can refuse new files because it has exhausted inodes even when some byte capacity remains.
Start with read-only checks
df -h
df -i
lsblk
sudo du -xhd1 /var
sudo journalctl --disk-usage
sh
df reports filesystem usage; du counts reachable files under a directory. They can disagree when deleted files are still held open by a process or when mount points change what a directory contains. du can be I/O-intensive on a large tree, so inspect one likely area at a time.
Find growth before removing anything
Common sources include application logs, uploaded files, database data, package caches and container images. Identify the owner and purpose of the data. Do not delete database files directly or remove Docker volumes merely because they are large.
If a process holds a deleted log open, restarting that specific service may release space, but it can interrupt users. Diagnose first and schedule the change appropriately. Logs also need a retention policy so the problem does not recur.
Leave operational headroom
Updates, temporary files and database maintenance need free space. Keep usage visible and address growth before writes start failing. Guest disk expansion and filesystem growth are different steps; do not assume a larger allocation automatically resizes every layer.
See disk-full recovery, Docker storage considerations and backup planning.
Reference: GNU coreutils documentation.