Make iotop show only the most disk-intensive item

freezeiomonitoring

My laptop (no VM, just plain Ubuntu with encrypted home) freezes for 3 minutes a few times per day. During these 3 minutes, the disk LED indicates intense disk activity, and I can't even move the mouse or press CTRL-ALT-F1.

I want to use iotop to find out which process is causing this.
The problem with iotop is that it shows disk usage for all processes (huge table).
How do I limit iotop's output to only the first row?

The idea is to make iotop more efficient so that it manages to compute and write to the log file even when the system is super-slow, so letting iotop display the whole table and then grepping is not a solution.

Best Answer

Use -a to accumulate usage and -o to only show processes that did IO:

iotop -ao
Related Question