Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|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
add comment

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

This question came from our site for professional system and network administrators.

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); }'
share|improve this answer
    
Perfect, thanks :) –  Joda Sep 21 '10 at 5:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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