Can grub be installed on a md array?

Rashkae ubuntu at tigershaunt.com
Wed Oct 15 19:26:05 UTC 2008


> Thanks for the advice Mark and Rashkae. I guess now I actually have a 
> valid reason for having a separate partition for /boot. Would you 
> recommend setting the bootable flag for /boot partition on each drive or 
> just one of them?
> 

None of them.  (I'll try to explain, but this is technical, and while I
understand the process, I might get some terminology wrong)

This is how the boot process works.

The bios knows about hard drives, and knows which hard drive it is
supposed to boot from.

The bios reads the first x number of sectors from the hard drive device
(known as the boot sector, I think), and executes the instructions therein.

If the boot sector contains a ms-dos mbr, those instructions are to scan
the partitions, find the one that's marked boot or 'active,' and
read/execute the first x sectors from that partition.

If, on the other hand, the hard drive boot sector contains a standard
grub install, the instructions are to read the sectors of the hard drive
that contain the grub execution (stage 1.5, I think?) from where it was
written to disk when grub was installed.  Grub doesn't care at all about
boot partitions.

Now, if you really wanted to, (and had some kind of reason) you could so
something fancy.  You could install grub in a partition instead of the
hard drive boot sector (setup (hd0,0) instead of setup  (hd0), for
example.)  In which case, you would still need something, like the dos
mbr and the partition in which you installed grub be marked boot.  This
way, you can dual boot to Windows by simply changing boot partition  (or
 from the grub menu if you are booting from the grub partition.). When
you do it this way, you also no longer need to worry about Windows
overwriting your Linux boot... all you do is change boot partition and
grub is restored,, so this is a good option for people who will need to
re-install windows often on a dual-boot.

If you wanted to be really really fancy, you can install different grubs
on a partition, then install one grub to be the master on the hard drive
boot sector.  The master grub's job will then be to display a menu that
lets you chainboot to the next grub on a partition, which will display
it's own menu.lst.  This way, you can have multiple menu.lst's.  This
might be useful for someone who wants to load different linux distros,
but doesn't want to the grub update mechanism to step over each other.

Protip:  Dos MBR can only boot from a primary partition.  Lilo has the
ability to write a dos-like mbr that can also boot from a logical
partition (those are the partitions you create inside an extended
partition)  You don't have to use lilo as boot manager to benefit from
this, but I'm not at all sure that Windows itself would be able to boot
if installed in a logical partition.




More information about the ubuntu-users mailing list