How to prevent HDD spin-down.
freebsd at qeng-ho.org
Tue Mar 6 08:50:33 UTC 2018
On 06/03/2018 08:40, Arthur Chance wrote:
> 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]
OK, I found this about the standby timeout settings:
> The encoding of the timeout value is somewhat peculiar. A value of
> zero means "off". Values from 1 to 240 specify multiples of 5
> seconds for timeouts from 5 seconds to 20 minutes. Values from 241
> to 251 specify from 1 to 11 units of 30 minutes for timeouts from 30
> minutes to 5.5 hours. A value of 252 signifies a timeout of 21
> minutes, 253 sets a vendor-defined timeout and 255 is interpreted as
> 21 minutes plus 15 seconds.
An amusing coincidence: log2(58) = 5.858 (to 0.0003% accuracy).
More information about the freebsd-questions