Bill Shannon
2008-Feb-28 01:46 UTC
[dtrace-discuss] DTrace script to find who''s accessing my disk
Is there a dtrace script usable by novices (i.e., me) that will help me figure out which process is accessing my disk every 3 seconds? I moved my home directory to an external disk and now I can hear the disk rattle every 3 seconds. It''s driving me crazy! I really want to find the culprit. I found the DTraceToolkit and used the iofileb.d script, which is pretty close, but according to it there were no accesses to files on the disk I''m watching. That seems wrong. Really I''d like to get a trace as the accesses are happening, not a summary at the end. (BTW, any chance it''s zfs itself accessing the disk?) Thanks.
Nathan Kroenert
2008-Feb-28 02:06 UTC
[dtrace-discuss] DTrace script to find who''s accessing my disk
iosnoop in the dtracetoolkit... :) Bill Shannon wrote:> Is there a dtrace script usable by novices (i.e., me) that will help > me figure out which process is accessing my disk every 3 seconds? > > I moved my home directory to an external disk and now I can hear the > disk rattle every 3 seconds. It''s driving me crazy! I really want > to find the culprit. > > I found the DTraceToolkit and used the iofileb.d script, which is > pretty close, but according to it there were no accesses to files > on the disk I''m watching. That seems wrong. Really I''d like to get > a trace as the accesses are happening, not a summary at the end. > > (BTW, any chance it''s zfs itself accessing the disk?) > > Thanks. > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org
Adam Leventhal
2008-Feb-28 02:13 UTC
[dtrace-discuss] DTrace script to find who''s accessing my disk
Hey Bill, Take a look at /usr/demo/dtrace/iosnoop.d on your system. It''s an example which comes straight out of the chapter in the Solaris Dynamic Tracing Guide on the io provider: http://wikis.sun.com/display/DTrace/io+Provider Adam On Wed, Feb 27, 2008 at 05:46:11PM -0800, Bill Shannon wrote:> Is there a dtrace script usable by novices (i.e., me) that will help > me figure out which process is accessing my disk every 3 seconds? > > I moved my home directory to an external disk and now I can hear the > disk rattle every 3 seconds. It''s driving me crazy! I really want > to find the culprit. > > I found the DTraceToolkit and used the iofileb.d script, which is > pretty close, but according to it there were no accesses to files > on the disk I''m watching. That seems wrong. Really I''d like to get > a trace as the accesses are happening, not a summary at the end. > > (BTW, any chance it''s zfs itself accessing the disk?) > > Thanks. > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Fishworks http://blogs.sun.com/ahl
Mike Shapiro
2008-Feb-28 02:25 UTC
[dtrace-discuss] DTrace script to find who''s accessing my disk
On Wed, Feb 27, 2008 at 05:46:11PM -0800, Bill Shannon wrote:> Is there a dtrace script usable by novices (i.e., me) that will help > me figure out which process is accessing my disk every 3 seconds? > > I moved my home directory to an external disk and now I can hear the > disk rattle every 3 seconds. It''s driving me crazy! I really want > to find the culprit. > > I found the DTraceToolkit and used the iofileb.d script, which is > pretty close, but according to it there were no accesses to files > on the disk I''m watching. That seems wrong. Really I''d like to get > a trace as the accesses are happening, not a summary at the end. > > (BTW, any chance it''s zfs itself accessing the disk?) > > Thanks.# dtrace -n ''io:::start{@a[execname]=count()}'' Wait a minute, and then hit ctrl-C for a summary. If you want individual traces you can start with # dtrace -qn io:::start''{printf("%s\n", execname);}'' or add execname tracing to /usr/demo/dtrace/iosnoop.d of course you will see sched (zfs, pageout) waking up and doing chunks on a regular basis, but not every 3 secs. If you suspect a kernel issue you can aggregate by stack(). -Mike -- Mike Shapiro, Solaris Kernel Development. blogs.sun.com/mws/
Bill Shannon
2008-Feb-28 04:39 UTC
[dtrace-discuss] DTrace script to find who''s accessing my disk
Nathan Kroenert wrote:> iosnoop in the dtracetoolkit... :)Ah ha! (I should''ve looked harder.) Now if only I could figure out why my disk is making noise every 3 seconds even though no processes are accessing the disk. Should iosnoop see activity unrelated to any process?