iotop - Per-Process Disk I/O Monitor Cheatsheet
iotop is a top-like utility that displays disk I/O usage per process in real time. Where iostat tells you a device is busy, iotop tells you which process is doing the reading and writing, at what rate, and with what I/O priority. It is the fastest way to answer “what is hammering the disk right now?” It reads kernel accounting data and therefore needs root.
Installation
| Platform | Command |
|---|
| Debian/Ubuntu | sudo apt install iotop |
| Fedora/RHEL | sudo dnf install iotop |
| Arch Linux | sudo pacman -S iotop |
| Requirement | Kernel with CONFIG_TASK_IO_ACCOUNTING (standard) |
| Verify | sudo iotop --version |
Running
| Command | Description |
|---|
sudo iotop | Interactive live view of all processes |
sudo iotop -o | Only show processes actually doing I/O |
sudo iotop -a | Show accumulated I/O (totals, not rates) |
sudo iotop -P | Show processes (not individual threads) |
sudo iotop -u USER | Filter by user |
sudo iotop -d 5 | Refresh every 5 seconds |
The Display
| Column | Meaning |
|---|
TID/PID | Thread or process ID |
PRIO | I/O scheduling priority class |
USER | Process owner |
DISK READ | Current read rate |
DISK WRITE | Current write rate |
SWAPIN | % time spent swapping in |
IO | % time waiting on I/O |
COMMAND | The process command line |
Two header lines show Total and Actual disk read/write for the whole system.
Interactive Keys
| Key | Action |
|---|
o | Toggle --only (hide idle processes) |
a | Toggle accumulated vs rate |
p | Toggle processes/threads |
r | Reverse the sort order |
← / → | Change the sort column |
q | Quit |
Batch / Logging Mode
For scripts and capturing evidence, run non-interactively.
# Log the top I/O processes every 2s, 10 iterations, only active ones
sudo iotop -boPqqq -d 2 -n 10 > iotop.log
| Flag | Effect |
|---|
-b | Batch (non-interactive) mode |
-o | Only active processes |
-n N | Number of iterations |
-q | Quiet (repeat to suppress headers) |
-k | Kilobytes |
Common Workflows
# "What is writing to disk right now?" — only active, processes not threads
sudo iotop -oP
# Catch a periodic I/O spike over time
sudo iotop -boP -d 1 -n 60 > spikes.log
# Blame a user's processes for disk load
sudo iotop -oP -u appuser
I/O Priority (pairs with ionice)
iotop shows the PRIO (ionice) class; you change it with ionice.
| ionice class | Meaning |
|---|
ionice -c 1 | Realtime I/O priority |
ionice -c 2 -n 0..7 | Best-effort (default), level 0 = highest |
ionice -c 3 | Idle — only I/O when disk is otherwise free |
# Deprioritize a heavy batch job's disk I/O
ionice -c 3 -p $(pgrep -n backup)
| Tool | Answers |
|---|
| iotop | Which process is doing disk I/O |
| iostat | Whether the device is saturated |
| pidstat -d | Per-process I/O (scriptable, sysstat) |
| dstat/dool | Combined system view |
Workflow: iostat shows the disk is busy → iotop shows which process → ionice deprioritizes it.
Resources