I like to try out different Linux Distributions from time to time. This either means wiping out the old one or dual booting. The following are instructions for setting up several Linux distros to coexist on one machine.
First, you need to determine how you are going to partition your hard drive. In my case, I have a 200GB SATA hard drive. I suggest that you download the Gparted live CD, and create the partitions from that.
From previous experience, different distros will complain if they have to share a home directory - for example Gnome 2.12 on one, Gnome 2.14 on another are both using the same config files but are expecting different data in them. The solution I found for this was to create a separate partition called /data, which is common for all distros. This contains the data for my user account. Each distro then has its own /home, and a symbolic link to /data. You may need to add a line to /etc/fstab in order to mount the partition automatically. Something like this should work:
/dev/sda3 /data ext3 defaults 0 2
During the partitioning phase of each installation, create a mount point for the data partition as /data. This removes the need to edit the fstab manually.
Since different distros use different default values for the User ID (UID), make sure that you manually set them to be the same. I use 1000 for my first user. Change the permissions on /data to "700", which is "rwx......". This prevents any other users on your system from reading your files.
If you have more than one user on your system, then create user directories in /data and change the permissions and ownership of the user directories accordingly.
Many people suggest that you create a separate partition for /boot. This means that the grub configuration files can be edited from any distro. The /boot partition should be at least 100Mb, and make it at the beginning of your first hard drive. Format it as ext3.
I prefer to mount this partition as /grub. This way, the "central" grub is accessible from each distro, but the individual distro's boot loader is still in /boot. This prevents any distro from damaging the central grub setup by overwriting the central grub's configuration files.
| Mount Point | Size | Format | Description |
| /grub | 0.5 GB | ext3 | Boot partition, common for all distros |
| /data | 100 GB | ext3 | Data partition, common for all distros |
| swap | 2GB | swap | Swap Partition, common for all distros |
| / | 20 GB | ext3 | Root partition for Kubuntu |
| / | 20 GB | ext3 | Root partition for Fedora |
| / | 20GB | ext3 | Root partition for Slackware |
| / | 20GB | ext3 | Root partition for Debian |
| Free Space | 18GB |
The first step is to install GRUB to the boot partition. Boot up with a live CD (you can use the Gparted live cd that you used to partition with). Run the following commands in a terminal (assuming that the boot partition is /dev/sda1).
mount /dev/sda1 /mnt/mnt
cd /mnt/mnt
mkdir -p boot/grub
cp /usr/lib/grub/i386-pc/* /mnt/mnt/boot/grub
GRUB's files are now in the boot partition, and you need to setup GRUB itself. Run the following commands:
grub
root (hd0,0)
setup (hd0)
quit
Create a /mnt/mnt/boot/grub/menu.lst, using the vi editor:
# Pretty Colours
color cyan/blue white/blue
# Default to whatever entry we chose last time
default 0
# Time before the default selection is selected (10 seconds)
timeout 10
# Entries for each distro
title Empty /dev/sda4
root (hd0,3)
chainloader +1
title Empty /dev/sda5
root (hd0,4)
chainloader +1
title Empty /dev/sda6
root (hd0,5)
chainloader +1
title Empty /dev/sda7
root (hd0,6)
chainloader +1
title Empty /dev/sda8
root (hd0,7)
chainloader +1
When you reboot, you will get a GRUB menu, with the above entries. After you have installed each distro, edit this file to change the title.
Then install the distros. When prompted, install the boot loader for each of these to the first sector of its root partition.
After the installation is complete, edit /grub/boot/grub/menu.lst (remember that we are mounting the boot partition on /grub), and change the title to something appropriate.
I suggest that you set the timeout in /boot/grub/menu.lst for each distro to be 0 seconds, to save time. It is a good idea to test that everything is working properly before adjusting the timeout.
On my machine, I currently have Ubuntu, Fedora, Slackware and Debian installed, using the above method.
My menu.lst looks like:
# Ubuntu Edgy Eft
title Ubuntu Edgy Eft
root (hd0,0)
chainloader +1
# Fedora Core 5
title Fedora Core 5
root (hd0,3)
chainloader +1
# Slackware 11
title Slackware 11
root (hd0,4)
chainloader +1
# Debian Etch
title Debian Etch
root (hd0,5)
chainloader +1
The main advantage of this, is that I can install any distro to those partitions, and all I need to do is change the title. Also, Slackware used LILO by default, which this method handles nicely.
http://www.justlinux.com/forum/showthread.php?t=147959 - A post by "Saikee" on how he multi-boots 145 different operating systems on one machine. I used some of his ideas on this page.