[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: which process is accessing my hard drive?



On Mon, Mar 01, 2004 at 11:35:55AM -0500, Matt Price wrote:

> ps, attached).  But somehow the hard drive keeps spinning back up
> spontaneously.  Who's accessing my hard drive??  I don't have the
> slightest idea how to find out, or (even better) figure out how to
> stop it from happening.  
> Can anyone help me with this?

Some time ago I had the same problem and came out with this script, that lists
files sorted by access time:

#!/bin/sh
# Script ideas courtesy of Jeff Coppock
#   from the debian-laptop list
 
TIMEBACK=${1:-5}
 
EXCLUDE="-path /usr -prune -o -path /var/src -prune -o -path /var/opt/usr -prune -o"
WORKFILE=/ram/report_disk_access
 
cat /dev/null > $WORKFILE
 
for P in / /var
do
        find $P $EXCLUDE -mount -printf "%As %Ts %p\n" >> $WORKFILE
#       echo "$P List:"
#       find $P $EXCLUDE -mount -type d
 
#       echo "$P: Accessed in the last $TIMEBACK minutes:"
#       find $P $EXCLUDE -mount -amin $TIMEBACK
 
#       echo "$P: Modified in the last $TIMEBACK minutes:"
#       find $P $EXCLUDE -mount -mmin $TIMEBACK
done


Ciao,

Enrico



Reply to: