From: NeilBrown <neilb@suse.de>
To: den Hoog <speedyden@gmail.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: looking for advice on raid0+raid5 array recovery with mdadm and sector offset
Date: Tue, 21 Jan 2014 09:51:29 +1100 [thread overview]
Message-ID: <20140121095129.5d5d7f8b@notabene.brown> (raw)
In-Reply-To: <20140121091144.4873d3ec@notabene.brown>
[-- Attachment #1: Type: text/plain, Size: 2871 bytes --]
On Tue, 21 Jan 2014 09:11:44 +1100 NeilBrown <neilb@suse.de> wrote:
> On Mon, 20 Jan 2014 16:43:38 -0500 den Hoog <speedyden@gmail.com> wrote:
>
> > Hello Neil,
> >
> > thanks again for spending time on this when you're already swamped, I
> > appreciate it much
> >
> > the commands look logical for my setup (just a type on the chunk size,
> > needs tobe capital K)
> > I did not dare to fire off the last command last time, but as missing
> > seems to be available for imsm, I re-processed all of the commands
> > again
> >
> > the Raid0 is created without any trouble (only stating it is already
> > part of an array, confirmed with Y), but the raid5 array won't.
> > After it also stated sdc sdd sde are part of an array, and confirming
> > with Y for the create, it gives the following:
> >
> > "mdadm: unable to add 'missing' disk to container"
> > I'm using mdadm - v3.2.6 - 25th October 2012.
> > Could it be the 3.2.6 does not support missing for imsm?
>
> That's weird. I'm sure I tested it yesterday and it worked.
> Today it doesn't in exactly the way you describe.
> I'll have a poke and see what is happening.
OK I think I figured it out.
Firstly, to create an IMSM array with a missing device, every array in the
container must have the same device missing.
Now you cannot create the RAID0 with a missing device, so you need to create
a RAID5 in it's place instead.
So:
mdadm -C /dev/md/imsm -e imsm -n 3 /dev/sd[cde]
mdadm -C /dev/md0 -l 5 -n 4 -c 128K -z 512G missing /dev/sd[cde]
then create the radi5 you want:
mdadm -C /dev/md1 -l 5 -n 4 -c 128K missing /dev/sd[cde]
That creates the container with 3 devices, and two 4-device arrays each with
one device missing (every array in a container must have the same number of
devices, and must have the same number that are missing).
However the above will crash. That is the "secondly".
You need the following patch, or you can just collect the latest from
git://neil.brown.name/mdadm/
NeilBrown
commit 1ca5c8e0c74946f4fcd74e97c5f48fba482d9596
Author: NeilBrown <neilb@suse.de>
Date: Tue Jan 21 09:40:02 2014 +1100
IMSM: don't crash when creating an array with missing devices.
'missing' devices are in a different list so when collection the
serial numbers of all devices we need to check both lists.
Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/super-intel.c b/super-intel.c
index c103ffdd2dd8..f0a7ab5ccc7a 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5210,6 +5210,8 @@ static int create_array(struct supertype *st, int dev_idx)
int idx = get_imsm_disk_idx(dev, i, MAP_X);
disk = get_imsm_disk(super, idx);
+ if (!disk)
+ disk = get_imsm_missing(super, idx);
serialcpy(inf[i].serial, disk->serial);
}
append_metadata_update(st, u, len);
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2014-01-20 22:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-02 19:45 looking for advice on raid0+raid5 array recovery with mdadm and sector offset den Hoog
2014-01-06 1:41 ` NeilBrown
2014-01-06 6:53 ` den Hoog
2014-01-07 21:43 ` den Hoog
2014-01-16 21:03 ` den Hoog
2014-01-20 6:16 ` NeilBrown
2014-01-20 21:43 ` den Hoog
2014-01-20 22:11 ` NeilBrown
2014-01-20 22:51 ` NeilBrown [this message]
2014-01-24 23:13 ` den Hoog
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=20140121095129.5d5d7f8b@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=speedyden@gmail.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).