Discussion:
Laptop disk spindown
(too old to reply)
George Mitchell
2016-09-11 16:50:27 UTC
Permalink
Smartctl reports that my laptop disk has started and stopped
101,798 times in 2,027 hours of operation, or roughly once a
minute. I imagine that saves wear and tear on the disk, but
it also makes the laptop seem remarkably sluggish for an A8
based system. Isn't there some sysctl that will lengthen the
idle time before stopping the disk? I don't see one in the
ada man page. -- George
Eugene Grosbein
2016-09-11 17:04:44 UTC
Permalink
Post by George Mitchell
Smartctl reports that my laptop disk has started and stopped
101,798 times in 2,027 hours of operation, or roughly once a
minute. I imagine that saves wear and tear on the disk, but
it also makes the laptop seem remarkably sluggish for an A8
based system. Isn't there some sysctl that will lengthen the
idle time before stopping the disk? I don't see one in the
ada man page. -- George
Put the following to /usr/local/etc/rc.d/tune-spindown.
Perhaps, we could have more clever and generalized version in base...

#!/bin/sh

# PROVIDE: tune-spindown
# REQUIRE: FILESYSTEMS
# BEFORE: DAEMON
# KEYWORD: nojail

case "$1" in
*start)
camcontrol standby ada0 -t 300
# dd if=/dev/ada0 of=/dev/null bs=512 count=1 >/dev/null 2>&1
;;
stop)
camcontrol standby ada0 -t 0
;;
esac
George Mitchell
2016-09-11 17:07:33 UTC
Permalink
Thank you! -- George
Post by Eugene Grosbein
Post by George Mitchell
Smartctl reports that my laptop disk has started and stopped
101,798 times in 2,027 hours of operation, or roughly once a
minute. I imagine that saves wear and tear on the disk, but
it also makes the laptop seem remarkably sluggish for an A8
based system. Isn't there some sysctl that will lengthen the
idle time before stopping the disk? I don't see one in the
ada man page. -- George
Put the following to /usr/local/etc/rc.d/tune-spindown.
Perhaps, we could have more clever and generalized version in base...
#!/bin/sh
# PROVIDE: tune-spindown
# REQUIRE: FILESYSTEMS
# BEFORE: DAEMON
# KEYWORD: nojail
case "$1" in
*start)
camcontrol standby ada0 -t 300
# dd if=/dev/ada0 of=/dev/null bs=512 count=1 >/dev/null 2>&1
;;
stop)
camcontrol standby ada0 -t 0
;;
esac
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
Matthew D. Fuller
2016-09-11 17:10:45 UTC
Permalink
On Sun, Sep 11, 2016 at 12:55:27PM -0400 I heard the voice of
Post by George Mitchell
Smartctl reports that my laptop disk has started and stopped
101,798 times in 2,027 hours of operation, or roughly once a
minute. I imagine that saves wear and tear on the disk,
Actually, it dramatically _increases_ the wear and tear on the disk...
This is controlled by the drive firmware, not the OS, however, you
can often use camcontrol(8) to adjust it.
I don't have the exact command handy, sorry.
In /etc/rc.local on a system whose drives I once had to do this on,
I've got:

# Shut off APM on the drives to stop the load cycle count from blowing
# up.
# x-ref: http://forums.freebsd.org/showthread.php?t=9885
#for i in 0 2; do
#. /sbin/camcontrol cmd ada${i} -a "EF 85 00 00 00 00 00 00 00 00 00 00"
#done

(now, this is not a laptop, so "shut off APM" was a totally reasonable
hammer to swing here; whether there's something more nuanced that
would be preferable in the laptop case, I don't know)
--
Matthew Fuller (MF4839) | ***@over-yonder.net
Systems/Network Administrator | http://www.over-yonder.net/~fullermd/
On the Internet, nobody can hear you scream.
Loading...