You are not logged in.

#1 2010-07-24 06:36:08

Chris Denton
Member
Registered: 2010-07-23
Posts: 21

[SOLVED] Log hard drive read/writes

Is it possible to monitor everytime a file on the hard drive is read from or written to and to add that information to a log?

Last edited by Chris Denton (2010-07-25 10:32:57)

Offline

#2 2010-07-24 06:54:28

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: [SOLVED] Log hard drive read/writes

Offline

#3 2010-07-24 07:11:56

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: [SOLVED] Log hard drive read/writes

The only problem I see is that you'll end up with an endless loop...

1) Disk get's written to
2) inotify writes a log about the write
3) Go to step 1

Last edited by fukawi2 (2010-07-24 07:12:10)

Offline

#4 2010-07-24 07:16:23

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Re: [SOLVED] Log hard drive read/writes

Offline

#5 2010-07-24 10:21:30

Chris Denton
Member
Registered: 2010-07-23
Posts: 21

Re: [SOLVED] Log hard drive read/writes

Thanks. That seems to be working quite well.

One problem though, I notice I have to exclude /dev (otherwise it seems to get stuck in a loop like fukawi2 mentioned). This does raise a question though, I notice that it isn't actually accessing the physical disk when this happens, so I wonder, is there a way to tell it to only include events that occur on the disk?

Offline

Board footer

Powered by FluxBB