From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 16 00:49:02 2010 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.ORG Received: by hub.freebsd.org (Postfix, from userid 1233) id 20EF2106567A; Thu, 16 Sep 2010 00:49:02 +0000 (UTC) Date: Thu, 16 Sep 2010 00:49:02 +0000 From: Alexander Best To: Oliver Fromme Message-ID: <20100916004902.GA46401@freebsd.org> References: <201009152143.o8FLhE9p022233@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201009152143.o8FLhE9p022233@lurza.secnetix.de> Cc: freebsd-hackers@FreeBSD.ORG, mav@FreeBSD.ORG Subject: Re: Summary: Re: Spin down HDD after disk sync or before power off X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 00:49:02 -0000 On Wed Sep 15 10, Oliver Fromme wrote: > Warren Block wrote: > > [...] > > 8. Alexander Motin has an updated CAM version of the ATA system which > > will eventually replace the existing one. In -CURRENT, anyway. He was > > kind enough to look at my event handler. My understanding is that he is > > looking at implementing the head parking/standby mechanism in that new > > code. > > The patch below will work with the new CAM ATA driver > (i.e. ada(4) disks). It adds a sysctl, so you can switch > the spin-down off if you're going to just reboot: > # sysctl kern.cam.ada.spindown_shutdown=0 i haven't tested your patch yet, but i don't think deciding whether to spin down the hdd should be decided merely from the sysctl value. the hdd should spindown when a shutdown has been issued and not spindown, if a reboot has been issued. either people have the sysctl set to 1 in which case a reboot will cause a spindown (which isn't healthy for the hdd) ...or people will set it to 0 in which case everything remains just the way it is. imo the sysctl should stay, but shuld have a different meaning. if it is set to 1 (which should be the default) a shutdown will issue a spindown; a reboot won't. if for some reason people want back the current behavior (no spindown even during a shutdown) they need to set it to 0. deciding whether freebsd reboots or shuts down cannot be done from a script, since users might use the reboot or halt commands in which case (if i'm not mistaken) all shutdown scripts get skipped. cheers. alex > > This patch applies to stable/8, but I think it should > work with current, too (I haven't tried because I don't > have a machine running HEAD that has ada(4) disks). > > Best regards > Oliver > > > > > -- > Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. > Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: > secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- > chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart > > FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd > > Python is executable pseudocode. Perl is executable line noise. -- a13x