From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 6 20:57:39 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29B9A106564A for ; Fri, 6 Mar 2009 20:57:39 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from kiwi-computer.com (keira.kiwi-computer.com [63.224.10.3]) by mx1.freebsd.org (Postfix) with SMTP id 94BF08FC14 for ; Fri, 6 Mar 2009 20:57:38 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: (qmail 50320 invoked by uid 2001); 6 Mar 2009 20:30:57 -0000 Date: Fri, 6 Mar 2009 14:30:57 -0600 From: "Rick C. Petty" To: freebsd-hackers@freebsd.org Message-ID: <20090306203057.GA49994@keira.kiwi-computer.com> References: <200903041938.n24Jcqdr060153@lurza.secnetix.de> <20090304195614.GA179@britannica.bec.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090304195614.GA179@britannica.bec.de> User-Agent: Mutt/1.4.2.3i Subject: 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 Reply-To: rick-freebsd2008@kiwi-computer.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2009 20:57:39 -0000 On Wed, Mar 04, 2009 at 08:56:14PM +0100, Joerg Sonnenberger wrote: > On Wed, Mar 04, 2009 at 08:38:52PM +0100, Oliver Fromme wrote: > > Octavian Covalschi wrote: > > > I'm looking a way to spin down HDD just right before power off. Why? > > > > > > Because currently when I call "shutdown -p now", HDD is powered off at it's > > > full speed (7200.4) and as a result > > > I hear a noise of stopping/spinning down of HDD, and _this_ concerns me as > > > I'm afraid it can damage HDD. > > > > You don't have to spin down a disk before powering it off. > > The noise you hear is probably caused by the "autopark" > > feature of the drive. It is harmless. > > This is not true. Many hard disks don't like having to do an emergency > shutdown as it affects the disk life time negatively. That's what > happens if you poweroff the machine when the disks are still spinning. I believe you are incorrect. Most hard drives do an "autopark" of the head into the landing zone (which is near the spindle) when power is lost. My understanding is that because it is spinning so fast, the heads can fly for quite a long time so the HDD has enough time to autopark and such an operation does not consume much power. Thus the operation can be performed with a little capacitance or by using some of the mechanical energy in the spindle. If drives did not auto, there would be orders of magnitude more failures due to head crashes. The heads absolutely have to be retracted into the landing zone if the spindle speed is too low or the drive will fail. What's actually bad for the drives is the actual spinup and spindowns, which require the head to sit in the very bumpy landing zone until the drive reaches optimal spindle speed and thus enough airflow to safely move the heads around the platter without contact. Strangely, atacontrol(8) has a command for spindown (which is inherently bad for drives yet still a reasonable feature) but there is no command for spinup. I wish there was a spinup command because I've seen drives that won't do a spinup until they receive a special ATA command. I was never able to find any docs, so if anyone knows the command I'd be willing to write a patch against atacontrol! -- Rick C. Petty