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

Re: Debian + LVM + RAID1



On Wed, May 07, 2008 at 07:32:13PM +0200, Ivan Glushkov wrote:
> Damon L. Chesser wrote:
> > Ivan Glushkov wrote:
> >> Hi,
> >>
> >> I installed Debian on top of LVM and software RAID1 following this:
> >>
> >> http://dev.jerryweb.org/raid/
> >>
> >>
> >> Everything is fine except that I cannot boot the Debian afterwards
> >> ("Insert boot disk" message from the bios). I used /dev/sdc and
> >> /dev/sdd. First problem is that I do not know which hdd I should enter
> >> as the first boot device in the bios. Moreover, obviously the bios does
> >> not see the /dev/md0 array, since I guess first the raid array should be
> >> started in order for grub to be loaded. I explicitly issued grub-install
> >> /dev/md0 using the recovery mode of the debian installer, but that did
> >> not help.
> >>
 > 
> > you can not put grub (/boot) on an LVM.  You can put /boot on a raid1. 
> > If you made one raid1 device and made one partition on md0 you will not
> > be able to boot (assuming you then put LVM on top of that one
> > partition/used all of md0).
> 
> No, that's not the problem. I followed exactly the mentioned article.
> There, two disks are used and partitioned in two partitions - the first
> ones are used for one RAID1, which is formatted as ext3 and used for the
> /boot directory (i.e. no lvm for /boot). The second partitions on both
> disks are arranged in a second RAID1 array on which I have created
> separate logical volumes for / /usr /var and so on.
> 
> > 
> > Redo what you did only make either two partitions to md0, one for boot
> > (110Mb is large enough for most) and on partition2 put the rest of your
> > system ontop of the LVM.  Or, partition your two hds to have two mdadm
> > raid1 .  One small md0 for /boot and one md1 for the system with LVM on it.
> > 
> > You will then have to install grub on to hdd or if hdc fails, you will
> > not be able to boot as grub will be installed onto hdc MBR.  Makes sense?
> 
> I taught I have to install the grub on the raid array, thus the grub
> will put a copy of itself on the first partition on both hard drives,
> used for the raid1, right?

A raid1 array is special.  Each component looks like a non-raid disk
except for the raid controll sectors at the _end_ of the partition.
Therefore, your /boot is on raid1 maid up (I think) of /dev/hdc and
/dev/hdd.  Can the bios boot of those drives anyway or does it need hda
or hdb?  So the bios doesn't have to know about the md0.  It just reads
the drive as it it wasn't raid.

The bios finds grub.  Grub goes looking for the kernel in /boot.  Grub
also can't use raid, but also it can read one disk of a raid1 set.  It
finds the kernel and loads it.

In the process of installing, the installer would have built the
initrd.gz with the raid support built-in.  The kernel goes looking for a
root directory and uses the mapper section to sort out the LVM, which is
why the kernel command line includes /dev/mapper-something for the root.

The issue seems to be getting grub to load.  I haven't read the howto
reference you gave, since I don't have the bandwidth or the time.  What
was wrong with the instructions in the installation manual?  If you
follow them and still have a problem, you can get support directly from
the people who wrote the installer on the debian-boot mailing list.

Doug.



Reply to: