HetznerDocs

Search documentation

Find a Hetzner dedicated Linux topic

Running disk space and RAM usage

df answers “how full are the filesystems?” du answers “which folder is fat?” free answers “how much RAM and swap are used?” Together they tell you whether the dedicated server is healthy.

Disk space right now

Free space per filesystem

df -hdf -hTdf -h / /boot /var

Read Use%. Above about 80% on / or /var, start cleaning or expanding LVM. 100% can stop apt, logs, and databases.

Inodes (number of files), not just bytes

df -i

What is using the space

Largest folders

du -h --max-depth=1 / 2>/dev/null | sort -hdu -sh /var/* /home/* /root 2>/dev/nulldu -sh /var/log /var/lib /var/cache

Biggest files under /var

find /var -xdev -type f -printf '%s %p' 2>/dev/null | sort -n | tail

ncdu is a nicer interactive view:

Interactive disk usage

apt install -y ncduncdu /

RAM and swap

Human-readable memory

free -hfree -mwatch -n 1 free -h
ColumnMeaning
totalPhysical RAM the OS sees
usedIn use (includes cache depending on view)
availableWhat new programs can still get — trust this more than “free”
buff/cacheLinux using spare RAM as disk cache. This is normal.
swapOverflow on disk. Some swap use is OK. Constant heavy swap is slow.

Who is eating RAM

ps aux --sort=-%mem | headapt install -y htophtop

In htop, F6 sorts. Watch MEM% and CPU%. Press q to quit. top is always there if htop is not installed.

Classic top and vmstat

topvmstat 1 5cat /proc/meminfo

Is the disk busy?

I/O snapshot

apt install -y sysstatiostat -xz 1 5iotop -o

High %util on a disk in iostat means that device is saturated. On RAID1 both members should look similar. If one disk is much slower, check SMART.

Logs filling the disk

Journal and log sizes

journalctl --disk-usagedu -sh /var/logls -lhS /var/log | headjournalctl --vacuum-time=7d