Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Nov 2009 19:50:23 -0800 (PST)
From:      James Phillips <anti_spam256@yahoo.ca>
To:        Chuck Swiger <cswiger@mac.com>, David Allen <the.real.david.allen@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: APM
Message-ID:  <695093.21975.qm@web65503.mail.ac4.yahoo.com>
In-Reply-To: <2daa8b4e0911131642p4d5935d1vff9cac77a43610ea@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I was going to just respond to myself again, but I see I generated some dis=
cussion :)=0A=0AAnyway, In the =0Ahttp://forums.freebsd.org/showthread.php?=
t=3D1012=0A=0Apage at least two people mentioned the ATAidle utility. It is=
 not recommended for the same reason APM isn't: devices sleep without OS co=
nsent.=0A=0AAnyway, I now know the drive saves 5W spun down because this co=
mmand has immediate effect:=0A# ataidle -o /dev/ad4=0AFollowed shortly by:=
=0ANov 13 16:51:11 dusty kernel: ad4: TIMEOUT-WRITE=3DDMA retrying (1 retry=
 left) LBA=3D23261855=0A=0AI settled on (But using the rc.conf format):=0Aa=
taidle -I 6 -S 10 /dev/ad4=0Abecause I think the "Idle timer" (minutes) and=
 "Supsend timer" (minutes) stack to 16 minutes. Setting the suspend time ha=
s an effect of immediately spinning down the disk though (mentioned in the =
man page)=0A=0ANo logging means I have to figure out how often the drive sp=
ins up/down using other means. (I don't think the wake from idle (disk seem=
s to keep spinning) or suspend triggers a message.)=0A=0AChuck wrote:=0A":Y=
ou might also want to note that 2.5" laptop drives are/should be  explicitl=
y designed to spin down and park themselves much more often than generic ID=
E drives are; some generic desktop drives will fail quite rapidly (ie, in a=
 matter of months) if you attempt to spin them down many times a day.:"=0A=
=0AI suspect they are rated for a set number of power-on cycles. If (say) 5=
 shutdowns/day kills the drive in months, it must be rated for something li=
ke 1000. (hmm, I should look it up.)=0A=0AIdeally, I want 1-5 shutdowns a d=
ay, depending on use. I know for a fact I want the drives shutdown when the=
 server is "idling" for hours at a time. When set for a 15 minute time out =
(with atacontrol), the drive was not getting spurious shut-downs.=0A=0A--- =
On Fri, 11/13/09, David Allen <the.real.david.allen@gmail.com> wrote:=0A=0A=
> =0A> > % grep diskless /etc/rc=0A> > dlv=3D`/sbin/sysctl -n vfs.nfs.diskl=
ess_valid 2>=0A> /dev/null`=0A> > if [ ${dlv:=3D0} -ne 0 -o -f /etc/diskles=
s ]; then=0A> > =A0=A0=A0 sh /etc/rc.initdiskless=0A> > # Run these after d=
etermining whether we are booting=0A> diskless in order=0A> > # to minimize=
 the number of files that are needed on a=0A> diskless system,=0A> =0A> The=
 answer finally appears!=0A> =0A> A note to the OP.=A0 The only way I've fo=
und to keep a=0A> disk spun down=0A> under FreeBSD is using memory devices =
for both /var and=0A> /tmp.=0A> Disabling syslogd isn't enough, nor is modi=
fying=0A> /etc/crontab, root's=0A> crontab (or even disabling cron) to limi=
t disk=0A> access.=A0 But to use=0A> memory devices and have a "normal" sys=
tem, you'll need to=0A> re-populate=0A> both /var and /tmp at startup.=A0=
=A0=A0Which, it=0A> turns out, means starting=0A> with /etc/diskless.=0A=0A=
I think I thought of that (putting /var/log in RAM) on my own: it does not =
really fit what my server does though: it is a file server.=0A=0AI have abo=
ut 5-6GB set aside (big enough to hold a DVD image) for /var and /tmp, and =
only 256MB of memory. Backing the ramdisk with swap defeats the purpose.=0A=
=0AChuck wrote:=0A"rsync -a /var_template /var"=0AThat is only half the bat=
tle: you need a way to flush it to disk when it actually spins up; else ris=
k loosing log data (In the event of power/hardware failure).=0A=0AI suppose=
 a cron job backing up periodic filesytem snapshots is possible, but you wo=
uld have to trigger on the number of interrupts seen by the disk or somethi=
ng to avoid waking it. I was thinking /proc/interrupts , but that is a Linu=
x feature :P=0A=0ADo the messages from spinning the disk back up (with atac=
ontrol) have any hooks? I suppose if you are desperate, you can (tail+) gre=
p /var/log/messages. =0A=0A> Someone should add a section named=A0 "Non-Dis=
kless=0A> Diskless Operation"=0A> to the Handbook.=0A=0AI like to think wha=
t I am doing (with 10 year old hardware) is "cutting edge research." That i=
s to say, the normal mode of operation for servers is to hold your nose and=
 let them run 24/7. It is more reliable that way.=0A=0AThe current trend fo=
r mitigating that waste of energy is consolidation. If you can put a dozen =
servers in one box, hopefully only 1 or 2 will be active at once.=0A=0AHowe=
ver, I think drivers and hardware (like NICs with WOL) may have matured to =
the point that it is possible to run "non-critical" servers (and desktops) =
in such a way that they only turn on when needed. Suspend mode for the newe=
r desktops here draw only ~3watts: comparable to the power-off (soft-off) s=
tate.=0A=0A=0A> Thanks again for all the help!=0A> =0A=0A=0A      _________=
_________________________________________________________=0AMake your brows=
ing faster, safer, and easier with the new Internet Explorer=AE 8. Optimize=
d for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internet=
explorer/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?695093.21975.qm>