Jump to content
How to add more Linuxes to a multiboot system
Submitted by carlaschroder
Posted Aug 24 2009 01:52 PM
You have your nice new boot partition all set up, and your first Linux installed. Now you're ready to add more Linuxes. Install additional Linuxes into logical partitions. Then you'll need to create GRUB boot menu entries for each one.
First, prepare the system according to this how-to.
Next, boot the installation CD of the second Linux. This example uses Libranet Debian for the second Linux. When you get to the disk partitioning menu, select "Partition & layout drives." You will then see a menu showing the existing disk partitions. Highlight "Free" and select "New." Enter 2500 MB for the partition size. The mountpoint is /. Choose your filesystem type, and make sure "Initialize?" is checked. This is now /dev/hda6.
Select /dev/hda3 to "Modify." Select /home and Ext3, and do not check "Initialize?"
You may now go back and make changes to the partitioning, or select "Write" to write your new partition table to disk. After you select "Write," a warning will appear: "ALL EXISTING DATA ON THESE PARTITIONS WILL BE DESTROYED," with a list of partitions that are going to be formatted, or "initialized." Only / should be listed here.
Continue with the installation. When you get to the bootloader installation menu, do not overwrite the MBR. The installer will ask, "Do you want Linux to handle booting your system?" Say no. You want the boot files installed to the first sector of the root partition, which is /dev/hda6.
When Libranet requires a reboot, bring up the GRUB command shell at boot, and boot Libranet manually:
grub> root (hd0,0)
grub> kernel /boot/vmlinuz-2.4.21 root=/dev/hda6 ro
grub> boot When everything is working satisfactorily, edit menu.lst to add the new system to the GRUB boot menu.
Write down the partitions you create during installation; it will help when you edit menu.lst.
The Libranet installer will automatically find any existing swap partitions; you don't need to select them during installation.
You can edit menu.lst from any of your new Linuxes. Simply mount the boot partition, and there it is:
# mkdir /bootpartition
# mount /dev/hda1 /bootpartition
# vim /bootpartition/boot/grub/menu.lst
<a name="some of">This highlights some of the benefits of using a boot partition—you always know where it is, and it is safely isolated from your root filesystems.
Partitioning is probably the most complicated part of building a multiboot system. Use logical partitions as much as possible. With only four primary partitions available per physical hard disk, you'll run out pretty quickly if you don't.