My harddisk keeps crunching away, but I have nothing running that warrants this constant activity. How can I find out what is constantly accessing my harddisk?

I'm on a iMac, using Mac os x 10.6.4

link|improve this question
Thought the tag was enough - I've added os and version :) – Joda Sep 21 '10 at 4:36
Spotlight indexing? Is there a dot flashing in the middle of the magnifying glass on the top right corner? – fideli Sep 21 '10 at 5:40
Also consider answers to this questions: superuser.com/questions/89266/… (looks like exact duplicate for me). – rkhayrov Sep 21 '10 at 12:48
feedback

migrated from serverfault.com Sep 21 '10 at 5:23

This question came from our site for system administrators and desktop support professionals.

1 Answer

up vote 5 down vote accepted

DTrace is your friend:

# Files opened by process,
dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'

Here are other common commands (also listed in the DTrace Wikipedia article):

# New processes with arguments,
dtrace -n 'proc:::exec-success { trace(curpsinfo->pr_psargs); }'

# Syscall count by program,
dtrace -n 'syscall:::entry { @num[execname] = count(); }'

# Syscall count by syscall,
dtrace -n 'syscall:::entry { @num[probefunc] = count(); }'

# Syscall count by process,
dtrace -n 'syscall:::entry { @num[pid,execname] = count(); }'

# Disk size by process,
dtrace -n 'io:::start { printf("%d %s %d",pid,execname,args[0]->b_bcount); }'   

# Pages paged in by process,
dtrace -n 'vminfo:::pgpgin { @pg[execname] = sum(arg0); }'
link|improve this answer
Perfect, thanks :) – Joda Sep 21 '10 at 5:55
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.