Summary: Re: Spin down HDD after disk sync or before power off

Nathan Whitehorn nwhitehorn at freebsd.org
Thu Sep 16 15:06:46 UTC 2010


On 09/16/10 09:42, Warren Block wrote:
> On Thu, 16 Sep 2010, Alexander Best wrote:
>
>> On Wed Sep 15 10, Oliver Fromme wrote:
>>> Warren Block <wblock at wonkity.com> 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.
>
> It's been a while, but the problem I found when comparing the NetBSD
> code was that there didn't appear to be a way to tell from within the
> FreeBSD driver whether it was a shutdown or reboot.

Register a shutdown event handler? The second argument can be tested
against RB_HALT to determine what is happening.
-Nathan


More information about the freebsd-hackers mailing list