From owner-freebsd-questions@freebsd.org Tue Mar 6 08:50:33 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23CA8F40E3F for ; Tue, 6 Mar 2018 08:50:33 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from bede.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BA146B3E3 for ; Tue, 6 Mar 2018 08:50:32 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.qeng-ho.org (Postfix) with ESMTP id 6C903109E7; Tue, 6 Mar 2018 08:50:31 +0000 (GMT) Subject: Re: How to prevent HDD spin-down. From: Arthur Chance To: "J.B." , freebsd-questions@freebsd.org References: <99f2e64c-577c-20e1-b595-9b8391efaf8e@gmail.com> Message-ID: Date: Tue, 6 Mar 2018 08:50:31 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2018 08:50:33 -0000 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).