M HYPE SPLASH
// updates

Setting up a multi boot system with GRUB

By Sarah Scott

There are lots of OSs and Linux dists to install on your netbook, and I want to make it as easy as possible to install, remove and switch between them.

Just installing a dist and then another one after it will replace the GRUB boot screen every time, and some dists might override previous GRUB menus entirely.

On a previous machine I created a GRUB partition which chain-loads GRUB for each dist, but now I can't remember how I did it.

The hard drive is currently empty, since I started playing around with repartitioning. What is the easiest way to install GRUB to a partition? Links are welcome, but please no generic "install GRUB" guides because the ones I've found haven't been relevant to my particular situation (empty hard drive, multi boot environment, no CD/floppy)..

2 Answers

Just configure one grub install to find your various kernels.

Say you have three partitions. sda1 with windows int sda2 and sda3 with a linux distro each. Your grub config sould look like this:

title Windows
rootnoverify (hd0,0)
chainloader +1
title linux 1
root (hd0,1)
kernel /path/to/kernel1
title linux 2
root (hd0,2)
kernel /path/to/kernel2

This way you can load all OSes directly via one grub. Maybe you want to install grub into the partition boot record as well. Then you could chainload the linuxes also:

title Windows
rootnoverify (hd0,0)
chainloader +1
title linux 2
rootnoverify (hd0,2)
chainloader +1
title linux 1
root (hd0,1)
kernel /path/to/kernel1

The chainload option tells grub to load the first sector of the given partition where the next bootloader is located.

1

In GRUB 2, you would use the command sudo grub-install {your boot partition, e.g. /dev/sdb2} which should autodetect which drives have a bootable OS on them and create the appropriate config files. In GRUB2, you shouldn't configure the grub.cfg file by yourself, rather let GRUB2 work itself using the commands grub-install and update-grub.
This should even work from a LiveCD. It'll autodetect the GRUB2 on the hardisk and change those files.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy