> If I ran it every 2 seconds, the clicking stopped altogether.

The clicking would stop in that case due to the hard disk never reaching
a state of inactivity that was long enough to cause a park.  The same
thing would occur if you had a script touch a file every 2 seconds, most
likely.

The more often the disk is accessed, the more often it will unpark then
repark the heads, until it reaches the point where there is never enough
inactivity to park the heads.  For example, say your disk or default
bios settings decide to park the heads after just under three seconds.
The following would be true:

You touch the disk every two seconds:  The disk never parks.
You touch the disk every three seconds: The disk parks, then immediately
unparks.
You touch the disk every four seconds: The disk parks for approx. a
second, then unparks.
You touch the disk every eight seconds, the disk parks for approx. 5
seconds, then unparks.

..etc.

Now, assume you have a script that touches the disk every nine seconds,
which would mean the disk would unpark when touched, stay unparked for
about three seconds, and then park for about six seconds, at which point
your script would touch the HD again.
Assume also (because this seems to be the behaviour) that something in
Ubuntu touches the disk every 30-45 seconds.

Your count would become irregular, because sometimes (every 30-45
seconds) Ubuntu is also touching the disk.  So, while usually the disk
would unpark after approx. 6 seconds, sometimes it would be:
You touch the disk.  In say, 2 seconds (before the disk parks), Ubuntu
activity touches the disk.  It waits another 3 seconds, then parks, and
4 seconds later, your script touches the disk again (unparking it).

Other times, it would be:
You touch the disk.  3 seconds goes by, and the disk parks.  A second
goes by, and Ubuntu touches the disk.  3 seconds goes by, and the disk
parks. 2 seconds goes by, and your script touches the disk again.

But, usually, it would be:
You touch the disk.  3 seconds goes by, and it parks.  6 seconds goes
by, and you touch the disk again.

..not that all that matters, precisely, though it's a good test case.
But whatever activity it is that is accessing the disk in Ubuntu does
matter.  That activity needs to be studied to find out:

1) What is accessing the disk
2) Whether those accesses are necessary or not
3) If they are unnecessary, stop them.
4) If they are reasonably necessary, but can can be decreased in
frequency, that should be done.
5) If they are reasonably necessary, but can be buffered, that should be
done.
6) One way or the other, when the system is idle, activity should (on
average) be less than 1 per 2.5 minutes.  That would put the
600,000-park HD at almost 3 years of life.
7) Ideally, this would be ~1 access per 5 minutes on an idle system.
That would leave the 600,000-park HD at around 6 years of life.
8) Also ideally, the APM should be configurable, to optionally allow
less aggressive power settings, with a warning that unparked HD's are
more susceptible to damage, so it might not be a good idea for laptop
users (if the system isn't accessing the disk all the time).

Overall, if Ubuntu used the disk less, it would mean that the HD would
park during idle periods, and just stay parked for the next 2.5 to 5
minutes, after which it would unpark, do its business, and then park
again.

I'm curious if this is a swap issue.  Assuming your laptop has enough
memory, have you tried turning off swap?  

{{{sudo swapoff -a}}}

After that, see if it still parks/unparks often (without your script
that touches the disk, obviously :-)).  If it's the issue, or part of
the issue, it should decrease the number of parks/unparks, I.e., your
system should just park, and then sit there for a while.

-b

-- 
Hard drive spindown should be configurable
https://bugs.launchpad.net/bugs/17216
You received this bug notification because you are a member of Ubuntu
Bugs, which is a direct subscriber.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to