0

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.

Jonas Byström
  • 194
  • 2
  • 12

2 Answers2

1

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.

Bart Silverstrim
  • 31,172
  • 9
  • 67
  • 87
0

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

Raffael Luthiger
  • 2,001
  • 2
  • 17
  • 26