Grub overlaping

Rashkae ubuntu at tigershaunt.com
Sat May 3 21:01:31 UTC 2008


Anna EdwARds wrote:
> I have a grub machine with access to easily twenty thousand booting operating systems on 4 thousand machines, and i was wondering. Is it possible for grub to boot to another grub (or lilo, if necessary)? I want to be able to sort in a manner like a dichotominous key that you dont see everything at once. I know it seems crazy that i did this (i have been using linux siNce 2005) but i did. Can someone help me?
> 

Yes, this is entirely possible.


Let say you have 4 partitions, for example.

/sda1 (ext3 /boot for your default initial grub)
/sda2 (ext3 filesystem)
/sda3 (ext3 filesystem)
/sda4 (ntfs filesystem)


each of the two ext3 filesystems can be the root of a linux install, and
each have their own /boot directory with a menu.lst file.  In this
example, you would install grub (or lilo, if that's your cup of tea) in
the superblock of the partion.  Presumably, grub-install is the
preferred way to do this, but I'm not familiar with that script.

If I were to, for example, boot from a knoppix cd to do this, then I
would install grub by using these commands in the grub shell

device (hd0) /dev/sda
root (hd0,1)
setup (hd0,1)

Now if you install a msdos mbr, and make /dev/sda2 an active partition,
grub would launch from there and let you boot the system installed on
/sda2.  But what you want to do is create a new /grub/menu.lst on the
/dev/sda1 partition that chainboots the /dev/sda2 partition.  The entry
would look something like this.


title Grub on /dev/sda2
rootnoverify (hd0,1)
makeactive
chainloader  +1


then from the grub shell

device (hd0) /dev/sda
root (hd0,0)
setup (hd0)

Notice how in this instance, since I did not specify a partition on the
setup command, grub will be installed in the mbr of the hard drive,
rather than the superblock of a filesystem.








More information about the ubuntu-users mailing list