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.

  • Is your hard disk an SSD disk?
    – Nils
    Oct 11 '11 at 20:51
  • No, normal disk. Oct 12 '11 at 3:41
  • So this is not the SSD-write-back problem. I had a similar problem on a CentOS workstation with an AMD-multi-core CPU. I pinned it down to the cpuspeed-kernel-module. Does the problem vanish if you disable the power-saving-features of the CPU?
    – Nils
    Oct 12 '11 at 19:52

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

iotop -ao

Not exactly what I was looking for but close: iotop -o

So I will use:

sudo nice -20 sudo iotop -tbod10 > ~/iotop.log

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.