After installing a few applications to the iMac, which is an understatement in itself!, I realised that the hard disk was becoming increasingly audible at certain intervals. At the time the machine felt sluggish and it really disrupted the quiet environment I’m used to as of yet. The OS’s Activity Monitor sure enough showed the the high disk activity, but there was no obvious way to determine which was the offending process. After some digging around and some different combinations and a lot of piping I’ve narrowed down to the following command:
alias debug="sudo fs_usage -w -f filesys > ./fs_usage.log; egrep -e read fs_usage.log | less ; egrep -e write fs_usage.log |less; rm -rf fs_usage.log"
If you add this to your shell config file – in my case ~/.zshrc – then the debug command after requesting for the root password will collect some usage data and show sequentially the Reads and Writes that were requested until you broke the debugging( i.e. press C-c).
The last column to the right will contain the name of the process that requested the action. Once you go over the output – keep pressing Space to go to the next page – the most commonly appearing process will most likely be the one increasing the I/O of the HDD. In my case it was the anti-virus being triggered every time I was performing a Spotlight search. Quitting Kasperky’s antivirus from he menu bar seems to have brought back the normal use and quietness.
If the offending process is not easily identified with a web search then close down all critical applications with data you don’t want to lose – you do have a backup policy right? – and start terminating one process at a time:
sudo kill -9 <PID>;
Right now the Sophos antivirus seems to be much better. Any one have prior experience regarding antivirus software for macs?