Re: sync: why disk cannot spin down

From: Russell King (rmk@arm.linux.org.uk)
Date: Sun Jul 30 2000 - 17:37:33 EST


Xuan Baldauf writes:
> 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/



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