From man iotop
:
iotop tracks disk I/O by process, and
prints a summary report that is
refreshed every interval.
This is measuring disk events that
have made it past system caches.
Since this uses DTrace, only the root
user or users with the dtrace_kernel
privilege can run this command.
This may not be precisely what you want - but it's a ksh script which wraps around dtrace, so you should be able to figure out how to make dtrace do what you need, if iotop doesn't handle it by default.
However, something like iotop -C 5 12
should give you something to start with: it will output 12 samples, each 5 seconds long.
5Thanks for the suggestion regarding Spotlight. I was just now experiencing very high disk reads, threw my Boot Camp partition into the Privacy tab in Spotlight prefs, and immediately disk reads flatlined! Been driving me nuts for months. – Tim Keating – 2010-04-24T16:15:24.140
1Speculating here, but it might be something simple like
mds
updating Spotlight's index. – None – 2009-12-30T11:46:53.13749 times out of 10 spotlight is the problem. One thing I've noticed is that if you have a bootcamp partition, be sure to include it on the spotlight blacklist or mds will seem to always be chewing on it. – Bryan Schuetz – 2009-12-30T16:18:02.187