The tool you wished exists actually does: iotop
You heard it here last, to use sog‘s catchphrase. Haven’t you always wanted to track down the runaway process that was sucking up all your disk I/O? Now you can, with iotop. It’s a simple Python script, not even a full-out application. iotop uses the I/O accounting in newer 2.6 kernels >=2.6.20 (check whether /proc/self/io exists to see whether you’ve got it enabled) and requires at least Python 2.5 for AF_NETLINK sockets. Here’s what it looks like (click for larger image):
It shows overall disk read and write in MB/s. Per-process, it shows disk read and write speeds as well as percentage of time spent swapping in and percentage of time spent while waiting on I/O. In other words, it rocks.
To install it on Gentoo:
You might need to sync your tree because I just added it. It’s still got testing keywords, so if you’re running stable, do this:
echo =dev-lang/python-2.5* >> /etc/portage/package.keywords
echo sys-process/iotop >> /etc/portage/package.keywords