SI Learning
0% read · Practice is tracked separately
← My learning
Version 1 · Chapter 15Reading mode

Measure before you tune

By the end: Separate memory pressure, filesystem capacity, per-directory usage, and I/O activity.

The idea

One large number is rarely a diagnosis. Compare measurements over time and connect them to a symptom. Linux uses memory for useful caches, so low free memory alone does not prove pressure. df measures filesystem capacity while du totals reachable file usage; deleted-but-open files, sparse files, and mounts can make them differ.

Your command toolkit

free

What it solves: Inspect memory and swap.

bash
free -h

Start with available memory as well as swap and workload context. Do not treat cached memory as automatically wasted.

df

What it solves: Check filesystem capacity.

bash
df -h .

Shows the filesystem containing the current directory. df -i checks inode availability when creating files fails despite free bytes.

du

What it solves: Measure the space attributed to a directory.

bash
du -sh .

Reports disk usage under the path. This can be expensive on a large tree; begin with the relevant directory.

ncdu

What it solves: Explore directory usage interactively.

bash
ncdu -r .

-r enables read-only mode in common versions. Without it, interactive deletion features can change files; check local help.

vmstat

What it solves: Sample memory, CPU, and scheduling activity.

bash
vmstat 1 3

Collects three reports. The first often summarizes since boot; subsequent rows cover the interval.

mpstat

What it solves: Inspect CPU activity per processor.

bash
mpstat -P ALL 1 2

Part of sysstat on many distributions. Look for uneven load rather than assuming one aggregate percentage explains everything.

iostat

What it solves: Observe device I/O activity.

bash
iostat -xz 1 2

Also commonly in sysstat. Latency and queue metrics need device and workload context; utilization alone is not a universal saturation test.

quota

What it solves: Check per-user storage limits.

bash
quota -s

A quota can prevent writes even when a filesystem has free space. Output depends on quotas being configured and enabled.

Before you move on

Try the guided lab below. Compare the result with the explanation, then record your reasoning in the workbook. A missing optional program or a restricted environment is something to explain, not a reason to change system settings blindly.

Practice with evidence

  1. Predict the result
  2. Run the guided lab
  3. Compare the output
  4. Explain your choice

A worked example

Guided lab

bash
free -h
df -h .
df -i .
du -sh .

What to expect: Memory, byte capacity, inode capacity, and directory usage appear as different measurements. Choose a small practice directory for du.

Make it yours: Explain a case where df has free space but a write still fails. Record which evidence would distinguish inode exhaustion, a quota, and missing permissions.

Read further

Apply what you learned

Your private practice

Which command checks available inodes on the current filesystem?

Answers are private. Completion requires the correct knowledge-check answer and a written response when an activity is included.

Restore a downloaded workbook

Choose a recovery file for this course and version. Review the recovered copy before saving it to your account.

Ask a question or report a problem

Describe what needs attention. Your private answer is shared only if you select the option below.

All learning paths
SI CENTRALIZATION · LEARN

Linux Command Line: from first command to confident practice

24 chapters · Your own pace

0 of 24 chapters complete