Multi Distribution Boot Howto

From Super Grub Disk Wiki
Jump to: navigation, search

How do I boot several Linux distributions?

Contents

Other titles for this same problem.

  • I want to boot other Linux distributions but without any mess.

Introduction

Usually a user tries Linux and then decides to explore more Linux flavours. One problem is partioning because he had not thought about reserving some disk space for a second Linux distribution. After that problem there's the Distro Boot problem? How do I set up every Grub so that every Linux distribution is represented? Will I use one /boot partition? Will the different distro's kernel updates make other distro's grub menues not to boot the other distribution?

We will try to show right here some methods that can make your Multi Linux distribution experience easier.

I personally like the chainload method because each grub menu has associated its splashimage or its gfxboot menu.

Everyone of these methods suppose that you know how to make a menu.lst file and that you choose to save that menu.lst file in a given partition.

Let's suppose that your Linux distributions layout is:

sda1 (hd0,0) Windows
sda2 (hd0,1) Fedora 11
sda3 (hd0,2) Debian 5
sda5 (hd0,3) Sabayon 14

Chainload method

Distribution preparation

First of all we need to run the root and setup commands in every distribution (I mean in every distribution's partition). If you run root and setup in non-ext3 partition please check that these partitions support a partition boot record. If you do not check that you can loose all your partition data.


You will have to open a Grub terminal:

grub

And run:

grub> device (hd0) /dev/sda
grub> root (hd0,1)
grub> setup (hd0,1)
grub> root (hd0,2)
grub> setup (hd0,2)

and so on.

grub> quit
sync


menu.lst

Just edit your favourite /boot/grub/menu.lst file and write something like:

title Windows
rootnoverify (hd0,0)
chainloader +1
boot
title Fedora 11
rootnoverify (hd0,1)
chainloader +1
boot
title Debian 5
rootnoverify (hd0,2)
chainloader +1
boot

and so on.

Now that /boot/grub/menu.lst you will be able to boot your distributions.

Configfile method

menu.lst

Just edit your favourite /boot/grub/menu.lst file and write something like:

title Windows
rootnoverify (hd0,0)
chainloader +1
boot
title Fedora 11
root (hd0,1)
configfile /boot/grub/menu.lst
boot
title Debian 5
root (hd0,2)
configfile /boot/grub/menu.lst
boot

and so on.

Now that /boot/grub/menu.lst you will be able to boot your distributions.

Classic method

Classic method means doing nothing. Once you install the last distribution it adds to its own menu all the kernels from other distributions. (Well, that's in theory and sometimes it does not work as expected... just check the other methods in this same webpage. ;) )

One example about classic method not working is when Kernel between different versions expect different root arguments.

For example old version expects something as: root=/dev/hda3 and new version expects something as: root=UUID:349589348LAFSNMLVMALDFASDLÑF34859. For example opensuse 10.2 and opensuse 10.3 had a similar problem in the SGD forum.

Supergrub method

SuperGrubDisk's Grub installation

For this method to work you need to install SuperGrubDisk's Grub into your hard disk and the best place is a separated /boot partition. Get your Super Grub Disk's Cdrom, mount it, and copy: stage* files to your mounted /boot partition.

Something as:

mkdir /mnt/boot
mount -t ext3 /dev/sda2 /mnt/boot
mount /cdrom
mkdir /mnt/boot/grub
cp /cdrom/boot/grub/stage2 /mnt/boot/grub/stage2
cp /cdrom/boot/grub/stage1 /mnt/boot/grub/stage1
cp /cdrom/boot/grub/*stage1_5 /mnt/boot/grub/

menu.lst

default 0
timeout 0
title default
selectfile /boot/grub/menu.lst /grub/menu.lst /boot/grub/grub.conf /grub/grub.conf
root $(out_device)
configfile $(out_device)$(out_file)

Inconvenients

  • Selectfile command does not admit timeouts.
  • There is no splashimage support in SuperGrubDisk's grub.

One thing you should know

Sometimes BIOS do not allow you to install grub on its own partition because it is very far and you need a dedicated /boot partition near its beginning. Please check: Linux installation does not boot.

Resources