# monitoring hard drive activity ?



## maccatalan (Dec 27, 2005)

Hello.

I reinstalled Tiger, clean install, made all updates, but now I notice a highly increased activity of my external hard drive. And I don't understand why. Spotlight is not indexing it and no applications are open.

So here is my question:
Is there a way to know what files are being written/read on a hard drive ?

I know that going to the Activity Monitor we can get what files are used by a given process. But here I don't know what process to monitor, so I was wondering if there was a way to list/monitor all hard drive activity from the command line or any simple utility you know. (we will avoid writting our own program that registers to the kernel events notifier ;-) )

Thank you,
Pierre.


----------



## maccatalan (Dec 27, 2005)

before reinstalling my system I did lots of 'rm' on that external hard drive ... do you think the system would still try to keep track and clean all these previous actions ? (it's a journalized HFS+ volume) That would be amazing and very long/slow in time !


----------



## ElDiabloConCaca (Dec 27, 2005)

Spotlight may indeed still be indexing that drive -- just because Spotlight allows you to search the drive and appears to be finished indexing it doesn't mean that it's totally done -- it will still go back and import other information from the files for a more complete Spotlight index.  It may be indexing content from text/PDF files, or EXIF data from photos or optimizing the Spotlight database on that drive.

Running "top" in the Terminal, do you notice a process called "mdimport" taking up a few CPU cycles?


----------



## dichimac (Oct 2, 2009)

In my macbook pro (Snow Leopard) there is an intermittent writing activity which doesn't let the hard disk go to sleep: I tried to see what's happening with sudo fs_usage, and I found out that past every 30 seconds the same series of processes is repeated; here is a single instance:
20:41:08.188    WrData          D=0x00007c39  B=0xa000     /dev/disk0s2                                                                                                    0.033631 W launchd             
20:41:08.215  IOCTL             <DKIOCSYNCHRONIZECACHE>    /dev/disk0s2                                                                                                    0.027190 W launchd             
20:41:08.216    WrData          D=0x00004a88  B=0x200      /dev/disk0s2                                                                                                    0.000699 W launchd             
20:41:08.216  sync                                                                                                                                                         0.316780 W launchd             
20:41:08.216  select                   S=1                                                                                                                                30.316916 W KernelEventAgent    
20:41:08.217  sendto            F=4    B=0x1                                                                                                                               0.000015   KernelEventAgent    
20:41:08.217  getfsstat64                                                                                                                                                  0.000004   fseventsd           
20:41:08.217  getfsstat64                                                                                                                                                  0.000011   fseventsd           
20:41:08.217  select                   S=1                                                                                                                                 0.000168 W KernelEventAgent    
20:41:08.217  recvfrom          F=5    B=0x1                                                                                                                               0.000008   KernelEventAgent    
20:41:08.217    WrMeta[async]   D=0x0047e298  B=0x2000     /dev/disk0s2                                                                                                    0.000847 W launchd             

Is there a way I can avoid this to happen and get my hard drive to sleep?
PS Yes, I did check the option "put the hard disk(s) to sleep when possible".

Macbook Pro, 3.06 GHz Core 2 Duo, 4GB RAM, 7200RPM 320GB HD


----------



## belgiumes (Jan 8, 2010)

I know that going to the Activity Monitor we can get what files are used by a given process. But here I don't know what process to monitor, so I was wondering if there was a way to list/monitor all hard drive activity from the command line or any simple utility you know. (we will avoid writting our own program that registers to the kernel events notifier


----------



## caldis (Feb 22, 2010)

Hi belgiumes,

have a look in this thread at the apple discussion forum:
http://discussions.apple.com/thread.jspa?messageID=10971600#10971600


----------

