Linux Systems Triage

Linux Boot, Disk Full, Inodes & Performance Triage

When a Linux server crawls to a halt, throws "No space left on device" at 50% disk, or refuses to boot, you need fast, read-only diagnostics. Use this triage tree to isolate whether the bottleneck is CPU, RAM, Disk I/O, or Network before running any fix.

๐Ÿง Ubuntu / RHEL / Debian๐ŸŸข Beginner-Friendly๐Ÿ“… Updated: 2026
Linux Bottleneck Triage Tree (CPU / RAM / Disk I/O / Network)
START: SERVER SLOW? Run uptime & vmstat 1 5 CPU BOTTLENECK Load > CPU Cores (nproc) vmstat r > cores, high us/sy top / htop / pidstat RAM / OOM Low available / Swap si,so Processes killed by kernel free -h / dmesg | grep oom DISK I/O & SPACE High wa% or Disk/Inode 100% iostat %util ~100%, high await df -hi / iostat -xz 1 NETWORK Timeouts / Drops / Port Full CPU/Disk idle, clients hang ss -tulpn / ip -s link

1 Disk Full & Inode Exhaustion

Linux can run out of space in two ways: blocks (big files filling GBs) or inodes (millions of tiny files using up all file-index slots). Sometimes a deleted file even stays locked in memory by a running app.

df -h Disk Free (Human-Readable)
Check block storage usage across all mounted filesystems
Shows total size, used, available, and Use% in GB/MB. Watch / and /var.
๐Ÿ’ก Trick: Add -T (df -hT) to also see filesystem types like ext4, xfs, or tmpfs.
df -i Inode Usage Check
Check if you ran out of inodes (file metadata slots)
If df -h shows 45% free but apps say "No space left on device", check IUse% hereโ€”millions of tiny cache/session files can hit 100% inodes.
๐Ÿ’ก Trick: Every file needs 1 inode. Find inode hogs with sudo du --inodes -S / | sort -rh | head -n 10.
du -sh /* | sort -h Disk Usage Directory Ranking
Find which top-level folder is eating all your disk space
-s summarizes each folder, -h uses MB/GB, and sort -h sorts human sizes from smallest to largest at the bottom.
๐Ÿ’ก Trick: Drill down into the biggest folder next, e.g., sudo du -sh /var/log/* | sort -h.
sudo lsof +L1 Deleted-but-Open Files
Find ghost files deleted with rm that still lock disk space
When someone deletes an active log file, the name vanishes but the OS keeps the data until the process holding it closes or restarts.
๐Ÿ’ก Trick: Restart the PID shown in column 2 (or systemctl restart <service>) to reclaim the GBs instantly.
sudo find / -xdev -type f -size +100M -exec ls -lh {} + 2>/dev/null

2 CPU, Memory & I/O Triage

High load doesn't always mean a maxed-out CPU. Often the CPU is sitting idle waiting on a slow disk or swapping memory. Use these five commands together to pinpoint the real bottleneck.

uptime 1m / 5m / 15m Load Averages
See if system load is rising, steady, or recovering
Compare the 3 load numbers against your CPU core count (nproc). Load 8.0 on 4 cores = overloaded; 8.0 on 16 cores = healthy.
๐Ÿ’ก Trick: If 1m > 5m > 15m, the spike is getting worse right now.
vmstat 1 5 Virtual Memory & CPU Queue
Print 5 live 1-second snapshots of CPU, RAM, swap, and I/O wait
Watch r (runnable processes waiting for CPU), b (blocked on disk I/O), si/so (swap in/out), and wa (% CPU waiting on disk).
๐Ÿ’ก Trick: Ignore the very first line of vmstatโ€”it's the average since boot. Lines 2โ€“5 are live.
free -h RAM & Swap Usage
Check how much memory is truly available to apps
Always read the available columnโ€”not free. Linux uses spare RAM for disk cache (buff/cache) and gives it back instantly when apps need it.
๐Ÿ’ก Trick: Run free -h -s 2 to watch RAM every 2 seconds during a memory leak.
iostat -xz 1 sysstat package
Measure per-disk latency and saturation every second
-x shows extended metrics; -z hides idle disks. Watch %util (near 100% = saturated) and await (average ms per I/O request).
๐Ÿ’ก Trick: Healthy NVMe await is <1ms; >20ms means storage is choking.
sudo iotop -o Per-Process Disk I/O
See exactly which process is hammering your disk right now
Works like top, but ranks processes by disk read/write speed instead of CPU. -o hides idle processes so the culprit jumps out.
๐Ÿ’ก Trick: Press P inside iotop to group threads by process.
๐Ÿง  Memory Trick โ€” "Wait (wa) means Disk, not CPU!": In top or vmstat, if CPU wa is 60% and us is 5%, your CPU is boredโ€”it's stuck waiting on a slow hard drive or saturated SSD. Check iostat -xz 1 and iotop -o before upgrading CPU!

3 Systemd & Boot Recovery

Whether the server takes 4 minutes to boot, crashed on the previous boot, or dropped into a grub rescue> prompt, these tools show you what failed during startup.

systemd-analyze blame systemd Boot Profiler
List services ranked from slowest to fastest during boot
Pinpoints which unit delayed startup (e.g., a hanging NFS mount, slow cloud-init, or NetworkManager-wait-online).
๐Ÿ’ก Trick: Run systemd-analyze critical-chain to see the exact blocking dependency chain.
journalctl -b -1 -p err Previous Boot Error Logs
Read error-level logs from the boot right before the crash/reboot
-b -1 means previous boot (-b 0 is current boot), and -p err filters out info noise to show only errors and critical failures.
๐Ÿ’ก Trick: Check all recorded boots with journalctl --list-boots.
sudo fsck -y /dev/sdb1 Unmounted Filesystem Repair
Check and auto-repair filesystem corruption on an unmounted partition
Used from rescue mode or on data drives after an unclean power loss. For XFS filesystems, use xfs_repair /dev/sdb1 instead.
๐Ÿ’ก Trick: Always run umount /dev/sdb1 firstโ€”never run fsck on a mounted read-write disk.

GRUB Rescue Basics (When Bootloader Loses Its Partition)

If you see grub rescue>, GRUB can't find /boot/grub. List partitions with ls, locate the one containing /boot/grub, set root/prefix, and load the normal menu:

ls → ls (hd0,gpt2)/boot/grub → set prefix=(hd0,gpt2)/boot/grub → set root=(hd0,gpt2) → insmod normal → normal

4 Zombie Processes & OOM Killer

When Linux completely runs out of RAM, the kernel's OOM (Out-of-Memory) Killer sacrifices the biggest memory-hogging process to save the OS. Meanwhile, Zombie (Z) processes are already deadโ€”just waiting for their parent to clean up.

dmesg -T | grep -i oom Kernel Ring Buffer
Confirm if the kernel OOM Killer terminated your app
-T converts kernel timestamps into human-readable dates. Look for Out of memory: Killed process <PID>.
๐Ÿ’ก Trick: If dmesg wrapped, check journalctl -k | grep -i "killed process".
ps aux | grep Z Process State Check
Find Zombie processes (STAT = Z) cluttering the process table
A zombie uses zero CPU/RAM, but too many can exhaust PIDs. kill -9 won't remove a zombie because it's already dead.
๐Ÿ’ก Trick: Find the parent PID (PPID) with ps -eo pid,ppid,stat,comm | grep Z, then restart or signal the parent.

5 The Danger Zone (What NOT To Do)

โš ๏ธ 3 Commands That Destroy Linux Systems
1. Running fsck on a mounted read-write filesystem

Running fsck while the OS or apps are actively writing to the disk causes severe metadata corruption and data loss.

โœ… Safe habit: Unmount the partition first (sudo umount /dev/sdb1) or boot into a Live USB / single-user recovery mode for /.
2. Running rm -rf on / with unquoted variables

In a script, rm -rf $BUILD_DIR/* becomes rm -rf /* if $BUILD_DIR is emptyโ€”wiping the entire server.

โœ… Safe habit: Always quote variables and guard against empty values: rm -rf "${BUILD_DIR:?}/"* (aborts if unset or empty).
3. Running kill -9 on databases (PostgreSQL, MySQL, Redis)

SIGKILL (-9) kills the process instantly without flushing dirty memory pages or closing write-ahead logs, risking table corruption.

โœ… Safe habit: Use sudo systemctl stop postgresql or kill -15 <PID> (SIGTERM) so the database shuts down cleanly.