* Can't get drives containing spare devices to spindown
@ 2006-05-11 19:51 Marc L. de Bruin
2006-05-30 16:39 ` Bill Davidsen
2006-06-22 4:49 ` Marc L. de Bruin
0 siblings, 2 replies; 6+ messages in thread
From: Marc L. de Bruin @ 2006-05-11 19:51 UTC (permalink / raw)
To: linux-raid
Lo,
Situation: /dev/md0, type raid1, containing 2 active devices (/dev/hda1
and /dev/hdc1) and 2 spare devices (/dev/hde1 and /dev/hdg1).
Those two spare 'partitions' are the only partitions on those disks and
therefore I'd like to spin down those disks using hdparm for obvious
reasons (noise, heat). Specifically, 'hdparm -S <value> <device>' sets
the standby (spindown) timeout for a drive; the value is used by the
drive to determine how long to wait (with no disk activity) before
turning off the spindle motor to save power.
However, it turns out that md actually sort-of prevents those spare
disks to spindown. I can get them off for about 3 to 4 seconds, after
which they immediately spin up again. Removing the spare devices from
/dev/md0 (mdadm /dev/md0 --remove /dev/hd[eg]1) actually solves this,
but I have no intention actually removing those devices.
How can I make sure that I'm actually able to spin down those two spare
drives?
Thanks,
Marc.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't get drives containing spare devices to spindown
2006-05-11 19:51 Can't get drives containing spare devices to spindown Marc L. de Bruin
@ 2006-05-30 16:39 ` Bill Davidsen
2006-06-22 4:49 ` Marc L. de Bruin
1 sibling, 0 replies; 6+ messages in thread
From: Bill Davidsen @ 2006-05-30 16:39 UTC (permalink / raw)
To: Marc L. de Bruin; +Cc: linux-raid
Did I miss an answer to this? As the weather gets hotter I'm doing all I
can to reduce heat.
Marc L. de Bruin wrote:
> Lo,
>
> Situation: /dev/md0, type raid1, containing 2 active devices
> (/dev/hda1 and /dev/hdc1) and 2 spare devices (/dev/hde1 and /dev/hdg1).
>
> Those two spare 'partitions' are the only partitions on those disks
> and therefore I'd like to spin down those disks using hdparm for
> obvious reasons (noise, heat). Specifically, 'hdparm -S <value>
> <device>' sets the standby (spindown) timeout for a drive; the value
> is used by the drive to determine how long to wait (with no disk
> activity) before turning off the spindle motor to save power.
>
> However, it turns out that md actually sort-of prevents those spare
> disks to spindown. I can get them off for about 3 to 4 seconds, after
> which they immediately spin up again. Removing the spare devices from
> /dev/md0 (mdadm /dev/md0 --remove /dev/hd[eg]1) actually solves this,
> but I have no intention actually removing those devices.
>
> How can I make sure that I'm actually able to spin down those two
> spare drives?
--
bill davidsen <davidsen@tmr.com>
CTO TMR Associates, Inc
Doing interesting things with small computers since 1979
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't get drives containing spare devices to spindown
2006-05-11 19:51 Can't get drives containing spare devices to spindown Marc L. de Bruin
2006-05-30 16:39 ` Bill Davidsen
@ 2006-06-22 4:49 ` Marc L. de Bruin
2006-06-22 5:05 ` Neil Brown
1 sibling, 1 reply; 6+ messages in thread
From: Marc L. de Bruin @ 2006-06-22 4:49 UTC (permalink / raw)
To: Marc L. de Bruin; +Cc: linux-raid
Marc L. de Bruin wrote:
> Situation: /dev/md0, type raid1, containing 2 active devices
> (/dev/hda1 and /dev/hdc1) and 2 spare devices (/dev/hde1 and /dev/hdg1).
>
> Those two spare 'partitions' are the only partitions on those disks
> and therefore I'd like to spin down those disks using hdparm for
> obvious reasons (noise, heat). Specifically, 'hdparm -S <value>
> <device>' sets the standby (spindown) timeout for a drive; the value
> is used by the drive to determine how long to wait (with no disk
> activity) before turning off the spindle motor to save power.
>
> However, it turns out that md actually sort-of prevents those spare
> disks to spindown. I can get them off for about 3 to 4 seconds, after
> which they immediately spin up again. Removing the spare devices from
> /dev/md0 (mdadm /dev/md0 --remove /dev/hd[eg]1) actually solves this,
> but I have no intention actually removing those devices.
>
> How can I make sure that I'm actually able to spin down those two
> spare drives?
I'm replying to myself here which seems pointless, but AFAIK I got no
reply and I still believe this is an interesting issue. :-)
Also, I have some extra info. After doing some research, it seems that
the busy-ness of the filesystem matters too? For example, if I create a
/dev/md1 on /dev/hdb1 and /dev/hdd1 with two spares on /dev/hdf1 and
/dev/hdh1, put a filesystem on /dev/md1, mount it, put the spare drives
to sleep (hdparm -S 5 /dev/hd[fh1]), and leave that filesystem alone
completely, every few minutes for to me no obvious reason those spare
drives will spin-up. I can only think of one reason: the md subsystem
has to put some meta-info (hashes?) about /dev/md1 on the spare drives.
If I use the filesystem on /dev/md1 more intensively, those 'every few
minutes' seems to become 'every 15 or so seconds'.
I may be completely wrong here (I'm no md guru), but maybe someone can
confirm this behaviour? And if so, is there a way to control it? And if
not, what could happen here?
For the original problem I can think of a solution: removing the spare
drives from the array, get them to spin-down and use the mdadm monitor
feature to trigger a script on a 'Failed' event which adds a spare to
that array and remove any spin-down time from that spare. However,
although this sort-of fixes the problem, there is still an extra short
period of time where the raid1 array is not protected. If the scripts
fails for whatever reason, the raid1 array might not be protected for a
long time. Also, from an architectural point of view, this is really bad
and should not be needed.
Thanks again for your time,
Marc.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't get drives containing spare devices to spindown
2006-06-22 4:49 ` Marc L. de Bruin
@ 2006-06-22 5:05 ` Neil Brown
2006-06-22 5:22 ` Marc L. de Bruin
0 siblings, 1 reply; 6+ messages in thread
From: Neil Brown @ 2006-06-22 5:05 UTC (permalink / raw)
To: Marc L. de Bruin; +Cc: linux-raid
On Thursday June 22, marc@debruin.org wrote:
> Marc L. de Bruin wrote:
>
> > Situation: /dev/md0, type raid1, containing 2 active devices
> > (/dev/hda1 and /dev/hdc1) and 2 spare devices (/dev/hde1 and /dev/hdg1).
> >
> > Those two spare 'partitions' are the only partitions on those disks
> > and therefore I'd like to spin down those disks using hdparm for
> > obvious reasons (noise, heat). Specifically, 'hdparm -S <value>
> > <device>' sets the standby (spindown) timeout for a drive; the value
> > is used by the drive to determine how long to wait (with no disk
> > activity) before turning off the spindle motor to save power.
> >
> > However, it turns out that md actually sort-of prevents those spare
> > disks to spindown. I can get them off for about 3 to 4 seconds, after
> > which they immediately spin up again. Removing the spare devices from
> > /dev/md0 (mdadm /dev/md0 --remove /dev/hd[eg]1) actually solves this,
> > but I have no intention actually removing those devices.
> >
> > How can I make sure that I'm actually able to spin down those two
> > spare drives?
This is fixed in current -mm kernels and the fix should be in 2.6.18.
NeilBrown
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't get drives containing spare devices to spindown
2006-06-22 5:05 ` Neil Brown
@ 2006-06-22 5:22 ` Marc L. de Bruin
2006-06-22 5:32 ` Neil Brown
0 siblings, 1 reply; 6+ messages in thread
From: Marc L. de Bruin @ 2006-06-22 5:22 UTC (permalink / raw)
To: Neil Brown; +Cc: linux-raid
Neil Brown wrote:
>On Thursday June 22, marc@debruin.org wrote:
>
>
>>Marc L. de Bruin wrote:
>>
>>
>>
>>>Situation: /dev/md0, type raid1, containing 2 active devices
>>>(/dev/hda1 and /dev/hdc1) and 2 spare devices (/dev/hde1 and /dev/hdg1).
>>>
>>>Those two spare 'partitions' are the only partitions on those disks
>>>and therefore I'd like to spin down those disks using hdparm for
>>>obvious reasons (noise, heat). Specifically, 'hdparm -S <value>
>>><device>' sets the standby (spindown) timeout for a drive; the value
>>>is used by the drive to determine how long to wait (with no disk
>>>activity) before turning off the spindle motor to save power.
>>>
>>>However, it turns out that md actually sort-of prevents those spare
>>>disks to spindown. I can get them off for about 3 to 4 seconds, after
>>>which they immediately spin up again. Removing the spare devices from
>>>/dev/md0 (mdadm /dev/md0 --remove /dev/hd[eg]1) actually solves this,
>>>but I have no intention actually removing those devices.
>>>
>>>How can I make sure that I'm actually able to spin down those two
>>>spare drives?
>>>
>>>
>
>This is fixed in current -mm kernels and the fix should be in 2.6.18.
>
>NeilBrown
>
>
Thanks Neil for your quick reply. Would it be possible to elaborate a
bit on the problem and the solution? I guess I won't be on 2.6.18 for
some time...
Marc.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't get drives containing spare devices to spindown
2006-06-22 5:22 ` Marc L. de Bruin
@ 2006-06-22 5:32 ` Neil Brown
0 siblings, 0 replies; 6+ messages in thread
From: Neil Brown @ 2006-06-22 5:32 UTC (permalink / raw)
To: Marc L. de Bruin; +Cc: linux-raid
On Thursday June 22, marc@debruin.org wrote:
> >
> Thanks Neil for your quick reply. Would it be possible to elaborate a
> bit on the problem and the solution? I guess I won't be on 2.6.18 for
> some time...
>
When an array has been idle (no writes) for a short time (20 or 200
ms, depending on which kernel you are running) the array is flagged as
'clean'. so that a crash/power failure at that point will not require
a full resync. The 'clean' flag is stored on all superblocks,
including the spares. So this causes writes to all devices when there
is changes to activity status.
Even fairly quite filesystems see occasional updates (updating atime
on files, or such syncing the journal), and that causes all devices to
be touched.
Fix
1/ don't set the 'dirty' flag on spares - there really is no need.
However whenever the dirty bit is changed, the 'events' count is
updated, so just doing the above will cause the spares to get way
behind the main devices in their 'events' count so they will no longer
be treated as part of the array. So
2/ When clearing the dirty flag (and nothing else has happened),
decrement the events count rather than increment it.
Together, these mean that simple dirty/clean transitions do not touch
the spares.
NeilBrown
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-06-22 5:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-11 19:51 Can't get drives containing spare devices to spindown Marc L. de Bruin
2006-05-30 16:39 ` Bill Davidsen
2006-06-22 4:49 ` Marc L. de Bruin
2006-06-22 5:05 ` Neil Brown
2006-06-22 5:22 ` Marc L. de Bruin
2006-06-22 5:32 ` Neil Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).