linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Hill <robin@robinhill.me.uk>
To: Caspar Smit <c.smit@truebit.nl>
Cc: linux-raid@vger.kernel.org
Subject: Re: Trying to get POLICY working
Date: Fri, 31 Oct 2014 15:34:55 +0000	[thread overview]
Message-ID: <20141031153455.GA8615@cthulhu.home.robinhill.me.uk> (raw)
In-Reply-To: <CADvHm=ZLp08Ydp+P=gn+bu1=GgVORx0TSJoRU33z3UNubwQryQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2512 bytes --]

On Fri Oct 31, 2014 at 04:19:04PM +0100, Caspar Smit wrote:

> Hi all,
> 
> I'm trying to get the POLICY framework of mdadm working but I can't seem to.
> 
> As i understand in the man page of mdadm the Incremental and POLICY
> directives could allow adding a new disk without MD superblock as
> spare to an already active array:
> 
> "Note that mdadm will normally only add devices to an array which were
> previously working (active or spare) parts of that array.  The support
> for automatic inclusion of a new drive as a spare in some array
> requires a configuration through POLICY in config file."
> 
> Furthermore:
> 
> "If no md metadata is found, the device may be still added to an array
> as a spare if POLICY allows."
> 
> 
> To get the basics working I created a system with 3 disks /dev/sdb,
> /dev/sdc and /dev/sdd
> 
> Created a RAID5 with one missing disk:
> 
> mdadm -C /dev/md0 -l 5 -n 3 /dev/sd[b-c] missing
> 
> I set the POLICY in mdadm.conf to:
> 
> POLICY action=force-spare
> 
> This should add any device (passed through mdadm --incremental) as
> spare no matter what (Am i correct?)
> 
> Now when I do:
> 
> #mdadm --incremental /dev/sdd
> mdadm: no RAID superblock on /dev/sdd.
> 
> Well, i know there is no MD superblock on /dev/sdd but shouldn't the
> policy setting kick in here and add /dev/sdd as spare (and hence start
> rebuilding) to /dev/md0?
> 
> mdadm version: 3.2.5-5 (latest debian wheezy stable)
> kernel version: 3.2.63-2 (latest debian wheezy stable)
> 
According to the mdadm.conf manual page on my machine:
      The  action  item  determines the automatic behavior allowed for
      devices matching the path and type  in  the  same  line.  If  a
      device  matches  several  lines  with different actions then the
      most permissive will apply. The  ordering  of  policy lines  is
      irrelevant to the end result.

With the examples given being:
      POLICY domain=domain1 metadata=imsm path=pci-0000:00:1f.2-scsi-* action=spare
      POLICY domain=domain1 metadata=imsm path=pci-0000:04:00.0-scsi-[01]* action=include

So I'd guess that the path= entry is required (though the type value
would look to be optional, which is not clear from the text).

HTH,
    Robin
-- 
     ___        
    ( ' }     |       Robin Hill        <robin@robinhill.me.uk> |
   / / )      | Little Jim says ....                            |
  // !!       |      "He fallen in de water !!"                 |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2014-10-31 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 15:19 Trying to get POLICY working Caspar Smit
2014-10-31 15:34 ` Robin Hill [this message]
2014-11-01  0:20 ` NeilBrown
2014-11-03  1:54   ` NeilBrown
2014-11-03  9:43     ` Caspar Smit
2014-11-05  5:28       ` NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141031153455.GA8615@cthulhu.home.robinhill.me.uk \
    --to=robin@robinhill.me.uk \
    --cc=c.smit@truebit.nl \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).