[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: booting from a raid1

From: lee
Subject: Re: booting from a raid1
Date: Sat, 9 Oct 2010 13:05:57 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Fri, Oct 08, 2010 at 11:46:26PM -0400, Tom H wrote:
> On Fri, Oct 8, 2010 at 12:34 PM, lee <address@hidden> wrote:
> >
> > All that's needed for booting is compiled into the kernel, I'm not
> > using initrd at all. Not using initrd makes things a lot easier ...
> >
> > The question probably is why the kernel doesn't seem to know about the
> > RAID devices. If I understand things correctly, those might be started
> > only after the root partition has been mounted.
> > [...]
> >
> > In any case, before the root partition is mounted,
> > /etc/mdadm/mdadm.conf cannot be read. So how can the software RAID
> > devices be brought up before the root partition is mounted?
> >
> > How does one tell grub to bring up the software RAID devices? It seems
> > that the modules "raid" and "mdraid" are required, and I've put them
> > into the grub.cnf. Perhaps I also need to put some information into
> > grub.cnf about what physical devices/partitions to use to bring up the
> > RAID devices. But how do I do that?
> A few answers in random order:

In a different order:

> 3. You need an initrd to have an mdraid'd /boot with 1.x metadata, see
> "/usr/share/doc/mdadm/md.txt.gz".
> 1. Why do you think that "raid autodetect" is deprecated? If you allow
> d-i to create an array, it formats the partitions "raid autodetect".

1.) When you google for "raid autodetect deprecated", you'll find many
pages saying that it's deprecated.

2.) I've had quite a surprise once with a RAID1 that was "autodetect"
when the RAID got suddenly started automatically after installing
mdtools, at a point where it shouldn't have been started.

3.) One could conclude from /usr/share/doc/mdadm/md.txt.gz that "raid
autodetect" is deprecated with kernels >= 2.6.9 and superblocks other
than 0: "As of kernel 2.6.9, only drives with a type 0 superblock can
be autodetected and run at boot time." --- It would be contradictory
to set the type of a partition to "raid autodetect" that has another
type of superblock than 0. Perhaps someone started saying that "raid
autodetect" is deprecated in a simplification, but since kernel 2.6.9
and the old type superblock are outdated, it is what it comes down to.

4.) What happens when you have a partition set to "raid autodetect"
with another type of superblock than 0 and a kernel older than 2.6.9?
Maybe nothing, but I'd rather be on the (hopefully) safer side by
designating the partition as "non-FS data" so it'll be left alone.

5.) In my case, "raid autodetect" is useless, and that's probably why
I need an initrd just as you say.

> Your latest setup with /boot on a single disk would boot easily with
> an initrd; without an initrd, adding "md=d<md device no.>,dev0,dev1"
> (see document in point 3) to the linux line might assemble the
> array.

You're probably right, and it makes sense to me. Now I'll have to find
out how to create an initrd that'll bring up the RAID1. I won't use
kernel parameters because things would break when the cabling of the
disks changes, and data could be lost in such cases.

> 2. mdadm.conf isn't needed for an array to be assembled. mdadm can
> consult/scan /proc/partitions.

Yes, but isn't using mdadm.conf better than scanning? And mdadm is
/sbin/mdadm, so it's not available before the root partition is
mounted ...

> 4. I've tried installing grub2 on a partitioned mdraid'd disk from d-i
> and from a chroot and both methods failed so I doubt (but would be
> happy to be proven wrong) that grub2 can recognize partitioned md
> devices with or without "insmod raid" and insmod mdraid".

Yeah, same here --- but the problem was that the device to install
couldn't be found. When you use LVM, you can get it to work.

Yet I think it's a bug in the installer. It's kinda "natural" or
"intuitive" to me to create a RAID first and then partition it. The
RAID substitutes the physical disk. You do the same with a hardware
RAID controller. Why would I partition physical disks first and then
make RAIDs from the partitions? It would be like putting the cart in
front of the horse. So the installer should either just work or give
the user instructions that it doesn't and what to do :)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]