Subject: Re: Spinning down idle disks
To: Bernard Gardner <B.Gardner@eng.usyd.edu.au>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 02/21/1996 09:38:04
> 
> The story so far:
> My home machine is in an alcove off my bedroom, it's a IIsi with an external
> hard disk, a ZIP drive and a Portrait monitor. That's three fans (one in the
> monitor) and three drive mechanisms, and that makes for a lot of whirring in
> the middle of the night.
> 
> The inspiration:
> The ZIP stops its spindle after a little bit of inactivity (ZIPs are strange
> little beasts), and that made me think that it wouldn't be a bad idea to stop
> the other disks too. The machine is largely idle while I'm trying to sleep, it
> would probably be a good thing.
> 
> The brilliant idea:
> So, my idea was to either stick a timeout in the SCSI routines that would send
> a stop unit command to disks that hadn't been used for a while, and then send
> them a start unit when they were wanted again.

You might ask on current-users as this question sounds like a NetBSD-wide
kinda thing.

> The immediate benefit to me:
> This would mean that one of the disks (the 40Mb internal MacOS only) would be
> spun down almost all of the time, which should reduce sound levels somewhat all
> by itself. It should also mean that the other disk would only be running when
> it was actually in use, which should reduce noise even further.
> 
> The questions I have are:
> 1) Has anyone else played with this at all? It's got obvious benefits for
> laptop machines, so I would expect that the code should already be around
> somewhere.
> 2) Does stop unit do what I expect i.e. stop the disk pack?
> 3) Can anyone see any nasty traps I need to watch for? Do the filesystems keep
> the disks constantly ticking, thereby stopping something like this from
> triggering?

File systems don't keep the drives ticking, but there is a cron job
(atrun, part of the "at" system) which runs every 10 minutes. If you
don't need this, you probably want to disable it so the disks won't
spring back to life every 10 minutes.

My first thought would be to teach the scsi code how to deal w/ spun
down drives correctly (to know when to spin up, and to wait for spin-up).
Talking with the SCSI driver-maker would be a good thing for this part
of the problem.

Then make a daemon which just sits around, looks at how long the drives
have been off, decides which ones should sleep, syncs them, and spins them
down.

> 4) Has anyone got some nice way of quietening the fans without risking heat
> damage to my hardware?

I think you can buy quiet fans. I'm not sure, but I suspect the original
fans are designed for an office environment. Quieter ones should be
available (for a price).

Good luck!

Bill