From: Tejun Heo <htejun@gmail.com>
To: Ric Wheeler <ric@emc.com>
Cc: Leon Woestenberg <leon.woestenberg@gmail.com>,
linux-raid@vger.kernel.org, Greg KH <gregkh@suse.de>,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>
Subject: Re: libata hotplug and md raid?
Date: Wed, 13 Sep 2006 20:06:41 +0900 [thread overview]
Message-ID: <4507E641.7090508@gmail.com> (raw)
In-Reply-To: <4507E2A9.7070306@emc.com>
Ric Wheeler wrote:
> (Adding Tejun & Greg KH to this thread)
Adding linux-ide to this thread.
>
> Leon Woestenberg wrote:
[--snip--]
>> In short, I use ext3 over /dev/md0 over 4 SATA drives /dev/sd[a-d]
>> each driven by libata ahci. I unplug then replug the drive that is
>> rebuilding in RAID-5.
>>
>> When I unplug a drive, /dev/sda is removed, hotplug seems to work to
>> the point where proc/mdstat shows the drive failed, but not removed.
Yeap, that sounds about right.
>> Every other notion of the drive (in kernel and udev /dev namespace)
>> seems to be gone after unplugging. I cannot manually removed the drive
>> using mdadm, because it tells me the drive does not exist.
I see. That's a problem. Can you use /dev/.static/dev/sda instead? If
you can't find those static nodes, just create one w/ 'mknod
my-static-sda b 8 0' and use it.
>> Replugging the drive brings it back as /dev/sde, md0 will not pick it up.
No, it won't.
> I have a similar setup, AHCI + 4 drives but using a RAID-1 group. The
> thing that you are looking for is "persistent device naming" and should
> work properly if you can tweak udev/hotplug correctly.
>
> I have verified that a drive pull/drive reinsert on a mainline kernel
> with a SLES10 base does provide this (first insertion gives me sdb, pull
> followed by reinsert still is sdb), but have not tested interaction with
> RAID since I am focused on the bad block handling at the moment. I will
> add this to my list ;-)
>
>>
>> The expected behaviour (from me) is that the drive re-appears as
>> /dev/sda.
Apart from persistent naming Ric mentioned above, the reason why you
don't get sda back is md is holding the internal device. It's removed
from all visible name spaces but md still holds a reference, so the
device cannot be destroyed. So, when a new device comes along, sda is
occupied by the dead device, and the new one gets the next available
slot, which happens to be sde in your case.
>> What is the intended behaviour of md in this case?
>>
>> Should some user-space application fail-remove a drive as a pre-action
>> of the unplug event from udev, or should md fully remove the drive
>> within kernel space??
I'm curious too. Would it be better for md to listen to hotplug events
and auto-remove dead devices or is it something which belongs to userland?
Thanks.
--
tejun
next prev parent reply other threads:[~2006-09-13 11:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-13 10:11 libata hotplug and md raid? Leon Woestenberg
2006-09-13 10:51 ` Ric Wheeler
2006-09-13 11:06 ` Tejun Heo [this message]
2006-09-13 11:45 ` Leon Woestenberg
2006-09-14 11:44 ` Turbo Fredriksson
2006-09-14 12:24 ` Leon Woestenberg
2006-09-14 23:23 ` Greg KH
2006-09-15 19:38 ` Leon Woestenberg
2006-10-17 0:23 ` Mark Lord
2006-10-17 1:58 ` Neil Brown
2006-10-17 8:07 ` Gabor Gombas
2006-10-17 8:11 ` Gabor Gombas
2007-01-10 22:55 ` Mike Accetta
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=4507E641.7090508@gmail.com \
--to=htejun@gmail.com \
--cc=gregkh@suse.de \
--cc=leon.woestenberg@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=ric@emc.com \
/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).