Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Mar 2018 08:50:31 +0000
From:      Arthur Chance <freebsd@qeng-ho.org>
To:        "J.B." <non.euc.geo.1854@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: How to prevent HDD spin-down.
Message-ID:  <faebeda5-0278-721e-381b-a08843327e82@qeng-ho.org>
In-Reply-To: <f1fe7770-c9fe-d8c1-9639-e3f78f9c1911@qeng-ho.org>
References:  <99f2e64c-577c-20e1-b595-9b8391efaf8e@gmail.com> <f1fe7770-c9fe-d8c1-9639-e3f78f9c1911@qeng-ho.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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/../../[234567]/05) \
>         -m root@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).



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?faebeda5-0278-721e-381b-a08843327e82>