I occasionally get a burst of hard drive activity that lasts for 10-20 secs and then stops. I have seen some posts suggesting some sort of indexing might be going on but I don't know how to investigate this.
The problem usually - but not always - happens on coming out of sleep. There is brief period of intense activity and then it stops. It is on a system that has not changed much over the last 4-5 years and has just started recently, maybe the last 4-6 months.
Just installed fatrace but that seems to be only realtime, what I need is history with time stamps so I can see what accessed the disk at a certain time.
My guess would be that this is caused by overdue cron jobs being started: There are a number of them that are supposed to run daily, weekly, monthly. Just look at
/etc/cron.*
:Back when it was really
cron
running those jobs (now it's probably using systemd timer units), that was supposed to run some time during the night when nobody would need that much computing power.But home or office PCs don't run during those night hours, so a fallback mechanism was created to have those background jobs run some time after the machine became active (after reboot or after resuming).
Some of those jobs are done so quickly you hardly even notice them; others, like updating the locate database, might take a while.
That particular one scans all filesystems on the off chance that you might want to use the
locate
command. It annoyed me enough to remove that package because I never uselocate
anyway (find
is so much more powerful).What you described sounds very much like that same problem.
Coming back to your specific question, catching those processes in the act is pretty difficult. When it starts, you can try our luck with the
top
command (or the GUI counterpart on your desktop) what unusual processes are active. But if they really do mostly disk I/O and little computing, you might not spot them.pstree
might also be helpful because it shows the process hierarchy.There are also
iotop
anddstat
(IMHO less helpful) and the oldvmstat
(never liked that one very much).