Linux RAID subsystem development
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Mark Knecht <markknecht@gmail.com>
Cc: Linux-RAID <linux-raid@vger.kernel.org>
Subject: Re: New machine, new RAID, wrong device name...
Date: Tue, 22 Feb 2011 08:23:12 +1100	[thread overview]
Message-ID: <20110222082312.75a72657@notabene.brown> (raw)
In-Reply-To: <AANLkTin=E7m==Q0NASXv72jiB0h3XJhZ4-vsxCS6CvJU@mail.gmail.com>

On Mon, 21 Feb 2011 11:59:06 -0800 Mark Knecht <markknecht@gmail.com> wrote:

> I've got a new laptop that has two hard drives in it and I've chosen
> to use RAID1 on it. The Gentoo install is complete but when I reboot
> the kernel doesn't find the RAID and I hang without syncing.
> 
> During the Gentoo install from a CD the machine is called (apparently)
> "livecd". To build the RAID initially I wanted it to be /dev/md3 so I
> used
> 
> livecd ~ # mknod /dev/md3 b 9 3
> livecd ~ # mdadm --create /dev/md3 --level=1 --raid-devices=2
> /dev/sda3 /dev/sdb3
> livecd ~ # mke2fs -j /dev/md3
> 
> and everything went fine.
> 
> However once I've rebooted using the CD, and even though the machine
> is once again called livecd the RAID is now called /dev/md127. I
> assume, but don't know for sure, that something similar is happening
> when I boot the actual installation, mdadm gives the RAID a different
> name and it's likely not found by my new environment.

If it is being assembled as md127 even though the host name is livecd, the
implication is that the hostname is not set un after the array is assembled.
Maybe they are done in the initrd in the wrong order?
If you 
   mdadm -S /dev/md127
   mdadm -As
from the livecd, does it then assemble as /dev/md3?

> 
> What's the right solution to changing the RAID naming in the
> superblock so that the laptop finds it as local to 'laptop1' and
> mounts it according the fstab?

I think you are asking how to change the name recorded in the metadata.
When booted into the livecd:
   mdadm -S /dev/md127
   mdadm -A /dev/md3 --update=homehost --homehost=laptop1 /dev/sd[ab]3

should do it.

NeilBrown


> 
> I understand that I can probably put the UUID in the mdadm config
> file, and I will, but before I do I wanted to cross this threshold and
> figure out the right way to do it automatically.
> 
> Thanks,
> Mark
> 
> 
> livecd ~ # mdadm --detail /dev/md127
> /dev/md127:
>         Version : 1.2
>   Creation Time : Wed Feb 16 16:03:29 2011
>      Raid Level : raid1
>      Array Size : 343758245 (327.83 GiB 352.01 GB)
>   Used Dev Size : 343758245 (327.83 GiB 352.01 GB)
>    Raid Devices : 2
>   Total Devices : 2
>     Persistence : Superblock is persistent
> 
>     Update Time : Thu Feb 17 19:42:36 2011
>           State : clean
>  Active Devices : 2
> Working Devices : 2
>  Failed Devices : 0
>   Spare Devices : 0
> 
>            Name : livecd:3  (local to host livecd)
>            UUID : f75493a8:1189516e:0f192f04:e21fbe28
>          Events : 17
> 
>     Number   Major   Minor   RaidDevice State
>        0       8        3        0      active sync   /dev/sda3
>        1       8       19        1      active sync   /dev/sdb3
> livecd ~ # mdadm --examine /dev/sda3
> /dev/sda3:
>           Magic : a92b4efc
>         Version : 1.2
>     Feature Map : 0x0
>      Array UUID : f75493a8:1189516e:0f192f04:e21fbe28
>            Name : livecd:3  (local to host livecd)
>   Creation Time : Wed Feb 16 16:03:29 2011
>      Raid Level : raid1
>    Raid Devices : 2
> 
>  Avail Dev Size : 687516763 (327.83 GiB 352.01 GB)
>      Array Size : 687516490 (327.83 GiB 352.01 GB)
>   Used Dev Size : 687516490 (327.83 GiB 352.01 GB)
>     Data Offset : 2048 sectors
>    Super Offset : 8 sectors
>           State : clean
>     Device UUID : 4430631f:454150f1:903a86cc:9d2c034c
> 
>     Update Time : Thu Feb 17 19:42:36 2011
>        Checksum : 9adbdc7f - correct
>          Events : 17
> 
> 
>    Device Role : Active device 0
>    Array State : AA ('A' == active, '.' == missing)
> livecd ~ #
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2011-02-21 21:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 19:59 New machine, new RAID, wrong device name Mark Knecht
2011-02-21 21:23 ` NeilBrown [this message]
2011-02-21 22:14   ` Mark Knecht

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=20110222082312.75a72657@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=markknecht@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