[lug] SW Raid question

dio2002 at indra.com dio2002 at indra.com
Tue Jul 24 16:19:03 MDT 2007


> Re: grub
> I don't remember if I had time to test this (short downtime), but these
> are the notes I had (borrowing from
> http://deb.riseup.net/storage/software-raid/)
>
> ----------------------------------
> grub> find /grub/stage1
>
> # should spit out (hd0,0) (hd1,0)
>
> Grub>device (hd0) /dev/sdb (/dev/hdb for ide)
> Grub>root (hd0,0) and then:
> Grub>setup (hd0)
>
> # Notice that we made the second drive device 0.  Why is that you ask?
> Because device 0 is going to be the one with mbr on the drive so passing
> these commands to grub temporarily puts the 2nd mirror drive as 0 and will
> put a bootable mbr on the drive and when you quit grub you still have the
> original mbr on sda and will still boot to it till it is missing from the
> system.

So here's the alternate method i've found online as well:

# grub
grub> root (hd0,0) --> setup first disk
grub> setup (hd0)
grub> root (hd1,0) --> setup second disk
grub> setup (hd1)

which i think is shorthand for the other method.  if this example is
correct, that device command in the first example (and many examples i see
online) is only there to make your life easier on the grub command line
and serves purely as an alias.  it does NOT have anything to do with how
the bios looks at the drive on boot.  and in fact, neither does the root
command if the second example is correct because that second drive would
become hd0 on reboot!  which means that first example is really misleading
as to what grub really is doing behind the scenes.  even though the first
example still works.  i've looked at the grub manual and it looks like
device is purely an alias as i described above.  but the root which is a
front end to the grub install command is a little unclear as to how that
relates to bios ordering if at all.

> If your first disk fails, however, your second disk will then be the first
> disk in the system, and so the MBR will be correct.

where this gets confusing is if you want to configure the boot menu for
each drive to boot the opposite disk when both mirrors are up.  That's
kind of silly in a mirrored situation however because it's not likely you
ever need it if you configure the boot loader to boot each drive upon
failover as described above.




More information about the LUG mailing list