Re: sync: why disk cannot spin down

From: Michael Bacarella (mbac@nyct.net)
Date: Sun Jul 30 2000 - 22:12:33 EST


Why is this even desirable?

Wouldn't you want the drives to just spin forever? I always understood
that spinning something down and then spinning it back up is what causes
them to degrade/die. The analogy would be that a car that runs it's engine
for 10 years straight never needs major repairs, whereas one that is
turned on, driven, turned off, repeat, will be slowly destroyed.

At least, this is what my high school science teacher taught us, which I
probably took for granted. Are hard drives an exception, or was I just
misguided? :)

-MB

> > this problem is possibly unrelated to
reiserfs but related to
> > linux-kernel, but now I can prove it: regular sync()s do prevent the
> > spindown of (IDE) disks. There will be a call to sync() after 32 or less
> > seconds have elapsed since the last sync(). Not a problem itself, but
> > every sync spins up the disk again.
>
> You may want to have a look at the atime/diratime mount options, or
> even chattr -A to prevent certain files causing a write when they're
> run/read.
>
> Note that just executing "sync" causes its atime to be marked for update,
> which will cause a write back to disk a short while later.
>
> What I tend to do is to partition my system in such a way that / and /usr
> can be mounted noatime (ie, all programs), /home is without any extra
> options, and /var with nodiratime. Eg:
>
> /dev/hda3 on / type ext2 (rw,noatime)
> proc on /proc type proc (rw)
> /dev/hda4 on /usr type ext2 (rw,noatime)
> /dev/hda5 on /var type ext2 (rw,nodiratime)
> /dev/hda8 on /home type ext2 (rw)
>
> Oh, I also set sshd to recreate its keys every 6 hours, and modify cron
> so it doesn't log to file (there doesn't seem to be a command line option
> for this).
>
> With all this, I can get my machines (setup the way I have them) to run
> for up to 6 hours without spinning up the drives (ie, over night). Oh,
> the other thing is that I have set the standby timer on the hard drive
> (hdparm -S) to be 10 minutes, which means its not spinning down during
> my normal use.
>
> Note that if you run stuff like xntpd, or squid, then it gets harder,
> but its still possible to achieve.
> _____
> |_____| ------------------------------------------------- ---+---+-
> | | Russell King rmk@arm.linux.org.uk --- ---
> | | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
> | +-+-+ --- -+-
> / | THE developer of ARM Linux |+| /|\
> / | | | --- |
> +-+-+ ------------------------------------------------- /\\\ |
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:32 EST