This isn't really an answer to the question you ask, but may help with the underlying issue. One tool I know of is
iotop, but it might not help to catch brief activity from a process.
Getting hard drives to sleep when idle can be difficult, because there are so many potential sources of activity. Just because you think your system is doing nothing doesn't mean something isn't writing in the background. Here are a few common culprits:
- Journal flushing. Linux flushes the ext3 (or ext4) journal at regular intervals whether it needs flushing or not. This can be tuned with the
commit mount option.
- System logs. Under a default configuration, some system logs are flushed whenever a line is written. Cron jobs are habitual offenders because they trigger an
auth log entry. You'll want a
- before all log file names in
If you really want your disks to spin down, check out noflushd. It really works (or at least it used to, it hasn't been maintained much lately and might have issues with contemporary kernels). But beware that it's a hack, and it's really heavy-handed: it simply stops the kernel from writing until either the cache is full or the disk wakes up anyway for a read.
If you're looking for silence, a technique that helps a lot is to suspend the disks from elastics instead of mounting it directly. This won't help reduce power consumption, but unless you have ≥10krpm drives (which require a screamer of a fan anyway), the CPU and motherboard are probably the main power drains even when idle.