linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Fredrik Pettersson <freppe@deimos.nu>
Cc: linux-raid@vger.kernel.org
Subject: Re: Why is my raid 1 boot/root not working with autodetect?
Date: Fri, 19 Jun 2009 12:10:00 +1000	[thread overview]
Message-ID: <19002.62328.200010.484984@notabene.brown> (raw)
In-Reply-To: message from Fredrik Pettersson on Thursday June 11

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).

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

  parent reply	other threads:[~2009-06-19  2:10 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 [this message]
2009-06-19  9:21     ` Fredrik Pettersson
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=19002.62328.200010.484984@notabene.brown \
    --to=neilb@suse.de \
    --cc=freppe@deimos.nu \
    --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).