From: Fredrik Pettersson <freppe@deimos.nu>
To: Neil Brown <neilb@suse.de>
Cc: linux-raid@vger.kernel.org
Subject: Re: Why is my raid 1 boot/root not working with autodetect?
Date: Fri, 19 Jun 2009 11:21:41 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.64.0906191110330.9419@deimos.nu> (raw)
In-Reply-To: <19002.62328.200010.484984@notabene.brown>
On Fri, 19 Jun 2009, Neil Brown wrote:
> On Thursday June 11, freppe@deimos.nu wrote:
>> I have done some more testing in an attempt to gather more data, and here
>> is what I have seen when testing different kernel options.
>>
>> When booting with my normal kernel options I get the following md output
>> during the boot:
>>
>> (raid=noautodetect md=0,/dev/sdb1,/dev/sdc1 md=d0,/dev/sdb2,/dev/sdc2)
>> -----
>> md: Skipping autodetection of RAID arrays. (raid=autodetect will force)
>> md: Loading md0: /dev/sdb1
>> md: bind<sdb1>
>> md: bind<sdc1>
>> raid1: raid set md0 active with 2 out of 2 mirrors
>> md0: unknown partition table
>> md0: unknown partition table
>> md: Loading md_d0: /dev/sdb2
>> md: bind<sdb2>
>> md: bind<sdc2>
>> raid1: raid set md_d0 active with 2 out of 2 mirrors
>> md_d0: p1 p2 p3 p4
>> md_d0: p1 p2 p3 p4
>> -----
>>
>> Everything is well and boots fine.
>>
>> If I change try to use autodetect but still keep the md= definitions:
>>
>> (raid=autodetect md=0,/dev/sdb1,/dev/sdc1 md=d0,/dev/sdb2,/dev/sdc2)
>> -----
>> md: Autodetecting RAID arrays.
>> md: Scanned 4 and added 4 devices.
>> md: autorun ...
>> md: considering sdc2 ...
>> md: adding sdc2 ...
>> md: sdc1 has different UUID to sdc2
>> md: adding sdb2
>> md: sdb1 has different UUID to sdc2
>> md: created md1
>> md: bind<sdb2>
>> md: bind<sdc2>
>> md: running: <sdc2><sdb2>
>> raid1: raid set md1 active with 2 out of 2 mirrors
>> md: considering sdc1 ...
>> md: adding sdc1 ...
>> md: adding sdb1 ...
>> md: created md0
>> md: bind<sdb1>
>> md: bind<sdc1>
>> md: running: <sdc1><sdb1>
>> raid1: raid set md0 active with 2 out of 2 mirrors
>> md: ... autorun DONE.
>> md: Loading md0: /dev/sdb1
>> md0: unknown partition table
>> md: couldn't update array info. -22
>> md: could not bd_claim sdb1.
>> md: md_import_device returned -16
>> md: could not bd_claim sdc1.
>> md: md_import_device returned -16
>> md: startind md0 failed
>> md: Loading md_d0: /dev/sdb2
>> md: could not bd_claim sdb2.
>> md: md_import_device returned -16
>> md: could not bd_claim sdc2.
>> md: md_import_device returned -16
>> md: starting md0 failed
>> -----
>>
>> In that case boot eventually fails with "mdadm: no devices found for
>> /dev/md_d0".
>
> That is because autodetect gave it a different name. The thing that
> was md_d0 is now md1. mdadm thinks md_d0 doesn't exist so it tried to
> assemble it and failed.
> the system then tries to mount things from /dev/md_d0p1 etc and that
> fails too.
>
> If you change fstab to mount from /dev/md1p1 etc it might work (since
> 2.6.28, all md devices are partitionable, you don't need the md_d*
> ones).
Thanks, that sounds like a good idea. I've actually changed fstab to use
the UUID rather than /dev/md* as that seemed like a good idea considering
that the devices might change names when I'm playing around with different
options. The boot fails when starting up mdadm though, so that should be
unrelated to fstab.
> However I recommend and you only use autodetect for the boot device,
> and allow mdadm to assemble all the rest.
> So change the partition type of sdc2 and sdb2 to something else
> e.g. 0xDA.
> Then auto-detect will ignore them, mdadm will find and assemble them,
> and all with be happy.
>
> NeilBrown
>
Now this sounds promising. So what you say is that if I just go with
autodetect for the boot device (in my case md0, sdb1 + sdc1), then later
in the boot process when mdadm is started it will create the other raid
devices even though they are not set as 0xFD? I will test that, thanks for
the advice.
Best Regards,
/Fredrik Pettersson
next prev parent reply other threads:[~2009-06-19 9:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-10 16:58 Why is my raid 1 boot/root not working with autodetect? Fredrik Pettersson
2009-06-11 8:44 ` Fredrik Pettersson
2009-06-18 8:21 ` Goswin von Brederlow
2009-06-19 2:10 ` Neil Brown
2009-06-19 9:21 ` Fredrik Pettersson [this message]
2009-06-19 9:34 ` Fredrik Pettersson
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=Pine.LNX.4.64.0906191110330.9419@deimos.nu \
--to=freppe@deimos.nu \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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).