All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Riemer <sebastian.riemer@profitbricks.com>
To: Ross Boylan <ross@biostat.ucsf.edu>
Cc: linux-raid@vger.kernel.org
Subject: Re: mdadm --fail doesn't mark device as failed?
Date: Wed, 21 Nov 2012 17:53:58 +0100	[thread overview]
Message-ID: <50AD0726.9090509@profitbricks.com> (raw)
In-Reply-To: <1353514677.5795.14.camel@corn.betterworld.us>

On 21.11.2012 17:17, Ross Boylan wrote:
> After I failed and removed a partition, mdadm --examine seems to show
> that partition is fine.
>
> Perhaps related to this, I failed a partition and when I rebooted it
> came up as the sole member of its RAID array.
>
> Is this behavior expected?  Is there a way to make the failures more
> convincing?

Yes, it is expected behavior. Without "mdadm --fail" you can't remove a
device from the array. If you stop the array with the failed device,
then the state is stored in the superblock.

There is a difference in the way mdadm does it and the sysfs method.
mdadm sends an ioctl to the kernel. With the sysfs command the faulty
state is stored immediately in the superblock.

# echo faulty > /sys/block/md0/md/dev-sdb1/state

If you reassemble that you'll get the message:
mdadm: device 0 in /dev/md0 has wrong state in superblock, but /dev/sdb1
seems ok

There is a limit of how many errors are allowed on the device (usually 20).

If you do the following additionally, your device won't be used for
assembly anymore.
# echo 20 > /sys/block/md0/md/dev-sdb1/errors

I guess this is related to: /sys/block/md0/md/max_read_errors.

> The drive sdb in the following excerpt does appear to be experiencing
> hardware problems.  However, the failed partition that became the md on
> reboot was on a drive without any reported problems.
>


  reply	other threads:[~2012-11-21 16:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 16:17 mdadm --fail doesn't mark device as failed? Ross Boylan
2012-11-21 16:53 ` Sebastian Riemer [this message]
2012-11-21 17:03   ` Ross Boylan
2012-11-21 17:10     ` Sebastian Riemer
2012-11-21 17:23       ` Ross Boylan
2012-11-21 17:47         ` Sebastian Riemer
2012-11-21 19:41           ` Ross Boylan
2012-11-22  9:43             ` Sebastian Riemer
2012-11-22 10:07               ` Sebastian Riemer
2012-11-24  0:29                 ` Ross Boylan
2012-11-21 19:52           ` Ross Boylan
2012-11-22  4:42   ` NeilBrown
2012-11-22  4:40 ` NeilBrown
2012-11-23 23:58   ` Ross Boylan

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=50AD0726.9090509@profitbricks.com \
    --to=sebastian.riemer@profitbricks.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=ross@biostat.ucsf.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.