How to prevent HDD spin-down.
freebsd at qeng-ho.org
Tue Mar 6 08:49:22 UTC 2018
On 06/03/2018 02:37, J.B. wrote:
> Hey. I purchased a new WD laptop hard disk drive, but it keeps spinning
> down and parking its heads after 25 seconds of inactivity. How can I
> disable that feature or extend the timeout to something less idiotic? I
> checked the BIOS, but there's no setting for it. I booted into a Linux
> (Debian-based) OS duel-booting on the same disk, and the disk doesn't
> spin down, so either Linux is doing something to override that feature,
> or FreeBSD is doing something to enable it (possibly a package I
> installed). Thanks.
I had the same problem and fixed it with sysutils/smartmontools. Here's
the start of my /usr/local/etc/smartd.conf (my mailer will line wrap).
The attributes to monitor came from Backblaze's document on what SMART
values are useful. It's the "-e" line that prevents spin down, but note
that this is for a *server* system that's always on mains power. On a
laptop this will probably eat your battery, so you'll need to tweak the
value. Unfortunately ISTR the number isn't just the timeout in seconds
but is more complex. You'll need to search for the exact spec I fear.
---- smartd.conf ----
# Monitor all disks. Use smartd_flags="-s /var/db/smartd/"
# and mkdir /var/db/smartd beforehand.
# set defaults for all drives. The test schedule is
# long Mon 4 am, short all other days 5 am
# read_error_rate is ignored because nobody knows what it means
DEFAULT -o on -S on \ # turn on offline tests, saving data
-e standby,off \ # turn off spin down
-H -f -C 197+ -U 198+ \ # report failures: health, old
age, sector problems
-t -R 5! -R 187! -R 188! \ # track attrs, report when
5,17,188 raw changes
-I 1 -I 9 -I 194 \ # ignore
-l error -l selftest \ # report errors, selftest fails
-s (L/../../1/04|S/../..//05) \
-m root at qeng-ho.org \ # mail root with problems
-M diminishing # repeat nags, but less frequently
[The disks you want to monitor go here]
An amusing coincidence: log2(58) = 5.858 (to 0.0003% accuracy).
More information about the freebsd-questions