Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Sep 2010 19:37:35 -0700
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        Alexander Best <arundel@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, mav@freebsd.org, Oliver Fromme <olli@lurza.secnetix.de>
Subject:   Re: Summary: Re: Spin down HDD after disk sync or before power off
Message-ID:  <AANLkTik9dCT60KDn5gVAsLi8-LRD5KFK1kKJO_9j=x-Z@mail.gmail.com>
In-Reply-To: <20100916004902.GA46401@freebsd.org>
References:  <alpine.BSF.2.00.1003051636030.2481@wonkity.com> <201009152143.o8FLhE9p022233@lurza.secnetix.de> <20100916004902.GA46401@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 15, 2010 at 5:49 PM, Alexander Best <arundel@freebsd.org> wrote=
:
> On Wed Sep 15 10, Oliver Fromme wrote:
>> Warren Block <wblock@wonkity.com> wrote:
>> =A0> [...]
>> =A0> 8. Alexander Motin has an updated CAM version of the ATA system whi=
ch
>> =A0> will eventually replace the existing one. =A0In -CURRENT, anyway. =
=A0He was
>> =A0> kind enough to look at my event handler. =A0My understanding is tha=
t he is
>> =A0> looking at implementing the head parking/standby mechanism in that =
new
>> =A0> code.
>>
>> The patch below will work with the new CAM ATA driver
>> (i.e. ada(4) disks). =A0It adds a sysctl, so you can switch
>> the spin-down off if you're going to just reboot:
>> # sysctl kern.cam.ada.spindown_shutdown=3D0
>
> i haven't tested your patch yet, but i don't think deciding whether to sp=
in
> 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 w=
ay 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 reboo=
t
> won't.
> if for some reason people want back the current behavior (no spindown eve=
n
> during a shutdown) they need to set it to 0.

Agreed. Spinning down at reboot isn't smart and seems like a good way
to kill a disk quicker.

> deciding whether freebsd reboots or shuts down cannot be done from a scri=
pt,
> since users might use the reboot or halt commands in which case (if i'm n=
ot
> mistaken) all shutdown scripts get skipped.

I'm not so sure of that statement, in particular because halt(8),
reboot(8), and shutdown(8) send SIGTERM to processes (unless you use
halt -q / reboot -q ... there might be some other scenarios I'm not
envisioning here).

Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTik9dCT60KDn5gVAsLi8-LRD5KFK1kKJO_9j=x-Z>