Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

Watching Hard Drive Activity With iotop On Ubuntu 8.10 And Debian Lenny


This article shows how you can watch your hard drive activity with iotop on Ubuntu 8.10 and Debian Lenny. iotop watches I/O usage information output by the Linux kernel (requires 2.6.20 or later) and displays a table of current I/O usage by processes or threads on the system. iotop displays columns for the I/O bandwidth read and written by each process/thread during the sampling period. It also displays the percentage of time the thread/process spent while swapping in and while waiting on I/O. In addition the total I/O bandwidth read and written during the sampling period is displayed at the top of the interface.

I do not issue any guarantee that this will work for you!
1 Installing iotop

Both Ubuntu 8.10 and Debian Lenny have iotop packages in their repositories, therefore the installation is very easy:

Ubuntu 8.10:

sudo apt-get install iotop

Debian Lenny:

apt-get install iotop
2 Usage

Usage is similar to the top program, you just type

iotop

and you will get a table of hard drive activity, updated every second:

Total DISK READ: 0 B/s | Total DISK WRITE: 706.11 K/s
PID USER DISK READ DISK WRITE SWAPIN IO> COMMAND
4288 root 0 B/s 706.11 K/s 0.00 % 0.00 % sftp-server
1 root 0 B/s 0 B/s 0.00 % 0.00 % init
2 root 0 B/s 0 B/s 0.00 % 0.00 % [kthreadd]
3 root 0 B/s 0 B/s 0.00 % 0.00 % [migration/0]
4 root 0 B/s 0 B/s 0.00 % 0.00 % [ksoftirqd/0]
5 root 0 B/s 0 B/s 0.00 % 0.00 % [watchdog/0]
6 root 0 B/s 0 B/s 0.00 % 0.00 % [events/0]
7 root 0 B/s 0 B/s 0.00 % 0.00 % [khelper]
3597 syslog 0 B/s 0 B/s 0.00 % 0.00 % syslogd -u syslog
3758 mysql 0 B/s 0 B/s 0.00 % 0.00 % mysqld –basedir=/usr –d
3909 root 0 B/s 0 B/s 0.00 % 0.00 % sshd: root@pts/0
152 root 0 B/s 0 B/s 0.00 % 0.00 % [pdflush]
153 root 0 B/s 0 B/s 0.00 % 0.00 % [pdflush]
154 root 0 B/s 0 B/s 0.00 % 0.00 % [kswapd0]
3760 mysql 0 B/s 0 B/s 0.00 % 0.00 % mysqld –basedir=/usr –d
1309 root 0 B/s 0 B/s 0.00 % 0.00 % [mpt_poll_0]
3635 messageb 0 B/s 0 B/s 0.00 % 0.00 % dbus-daemon –system
3615 root 0 B/s 0 B/s 0.00 % 0.00 % dd bs 1 if /proc/kmsg of
3617 klog 0 B/s 0 B/s 0.00 % 0.00 % klogd -P /var/run/klogd/k
3901 root 0 B/s 0 B/s 0.00 % 0.00 % getty 38400 tty1
3548 root 0 B/s 0 B/s 0.00 % 0.00 % getty 38400 tty4
3754 mysql 0 B/s 0 B/s 0.00 % 0.00 % mysqld –basedir=/usr –d

Type q to leave iotop.

To learn more about iotop and additional options, take a look at its man page:

man iotop
3 Links

Ubuntu: http://www.ubuntu.com/
Debian: http://www.debian.org/
iotop: http://guichaz.free.fr/iotop/

Comments

comments