Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Nov 2004 13:53:05 -0700
From:      "Kenneth D. Merry" <ken@kdm.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Tracing Disk Access
Message-ID:  <20041122205305.GA76707@nargothrond.kdm.org>
In-Reply-To: <20041122152254.GA1229@gicco.homeip.net>
References:  <20041122152254.GA1229@gicco.homeip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 22, 2004 at 16:22:54 +0100, Hanspeter Roth wrote:
> 
> Hello,
> 
> I have set an idle timeout for the hard-disk. But when there is no
> user activity there are frequent disk accesses.
> How can one trace disk access?
> I'd like to know the kind of access and on which files/directories/
> nodes. I'd like to log on the console or on a memory disk file.

Well, this isn't quite what you want, but if you have a SCSI disk you can
use the CAM debug facility to see what's going on.

Compile your kernel with the CAMDEBUG option.

Then run 'camcontrol debug -Ic bus:target:lun' where the bus, target and
LUN are the numbers displayed by 'camcontrol devlist'.

You'll see more console output than you care to see.  (It'll printout the
CDB for each command that goes down to that particular device.)

If this disk contains /var/log, you'll get into an interesting loop because
each console printf will cause syslog to write to the disk, which will
in turn cause another console printf.

Type 'camcontrol debug off' to turn it off.

Ken
-- 
Kenneth Merry
ken@kdm.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041122205305.GA76707>