I'm pretty new to Linux, so bear with me. On my 2.6.28-13-server #45-Ubuntu SMP, I am using

hdparm -W1 -S120 /dev/sda

to spindown the HD after 10 minutes. But every one or two hours or so, it spins up again for no apparent reason. I suspected /var/log/debug, kern.log, messages, syslog and auth.log since I had to fiddle some with the logging to get it to not write to these files every so often, but I have no indications of such behaviour any longer.

udhcpd, ddclient and dhclient3, are also among my suspects, but for no real reason.

I tried logging

lsof >whatever

and then checking back in a few hours, and that gave me nothing, so I guess that whoever is spinning up the disk is opening a file, writing to it, then closing it again?

Is there any way to find the culprit? Diagnose tool of some sort? Or simple script?

Edit: crontab is checked, and cron should not be the problem (if that table is the only possible way to generate disk writes from cron). Since I'm down to one write every few hours, I think I might get rid of "idle" writes entirely, it probably comes down to a single program.


Please check this question: Serverfault. With a high chance you will find your answer there.

  • 1
    iotop from that page is the best suggestion – Zanchey Aug 31 '09 at 3:04
  • I found echo 1 > /proc/sys/vm/block_dump very useful since I reduced the number of accesses so much already. – Jonas Byström Aug 31 '09 at 20:14

Check for a cron job running. It could be running something indexing the locate database. Do a quick grep for cron in the /var/log/directory and see what's running at that point, or check the crond settings with crontab.

Unix-type systems are often doing background chores periodically for things like cleaning logs, updating databases, etc...routine chore work. Usually nothing to worry about. If you need the drive to sleep and stay asleep you might have to actually put the machine to sleep or shut it down, or you can invest in some kind of SSD card instead of your current hard disk on which to install the OS and use the hard disk to just store your home partition. That might keep any routine chores from waking the disk (and speed up your operating system, too). that option would be a rather pricey way to save a few cents on the electric bill though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.