Advertisment

Build a Multi Linux System

author-image
CIOL Bureau
Updated On
New Update

There can be times when you need more than one Linux

distro on the same machine, like when you're

developing an application and want to make sure that it's compatible across all the

distros. This article

will talk about how to set up multiple Linux distros on

one machine. In order to do that, it's important to

first understand how Linux does partitioning. A Linux

system has three types of partitions, namely:



/boot The boot partition for kernel and initrd

images, which boots the PC and loads the kernel.



/- The root partition where files and other

applications are installed.



Swap For disk caching. This should be double the size

of RAM.





























face=Verdana size=2>Direct

Hit!
face=Verdana size=1>Applies to:

Developers wanting to test or develop code on

multiple Linux distros
face=Verdana size=1>USP: Multiple Linux

distros installed using one grub.conf

file
face=Verdana size=1>Links:

www.kerneltrap.org


We in this article will first install PCQLinux 2004

and then RedHat Enterprise 3.0 Edition distro on the

same machine. The machine used should be without any OS.

We will only install PCQLinux 2004 boot loader. The idea

here is that we will configure PCQLinux 2004 grub. conf

file and then modify the same grub.file for RedHat

Enterprise distro. The reverse can also be

done. 



Installing PCQLinux 2004 





  • Start PCQLinux 2004 installation. You will be

    given a list of installation types. Select the

    installation type you want. We selected Personal

    Desktop.

  • Now you need to partition the hard disk. There are

    two options for this: Automatic Partition and Manual

    Partition. Select the Automatically Partition option

    to partition the hard disk. Then, click on Next.

  • This will show three options for partitioning the

    hard disk. Select 'Remove all partitions on this

    system' option.

  • After this, you have to configure the partition

    table. As discussed above, three partitions have to be

    created. First, create the boot partition and don't

    change the default size for this partition, which

    would be around 100 MB. Then create the root partition

    and allocate space according to your hard disk size.

    Finally, create the swap partition with the default

    size for it.Â

  • Click on Next, which will ask for installing boot

    loader. Install PCQLinux 2004 boot loader, which is

    grub. Follow the steps till installation is complete.

  • Now PCQLinux 2004 is installed. Open the terminal

    screen and run the command fdisk~l. You will see

    the partition information as shown in the box below.

    It shows on which device the three partitions are

    installed. 


The boot partition is installed in /dev/hdc1, root

partition in /dev/hdc2 and swap in /dev/hdc3.



Installing RedHat Enterprise 3.0 





  • Start RedHat Enterprise 3.0 edition

    installation.Â

  • Follow the first four steps as above to install

    the three partitions in the remaining free space.

  • Clicking on Next will give the option of

    installing the RedHat Enterprise 3.0 boot loader.

    Here, you should not install the RedHat Enterprise 3.0

    boot loader. Click on 'change boot loader' option

    and then select 'don't install boot loader.'

    Follow the instructions to complete the installation.



Now, you have both the distros installed. But, you

need to configure the PCQLinux 2004 grub.file.



Configuring PCQLinux 2004 grub.conf

file

Boot PCQLinux 2004 system and run the

command fdisk~l. The partition information for both
the distros will be as shown as in the box below. The

important thing here is that all the three partitions

should be installed for both the distros.













vAlign=top align=middle bgColor=#787458>







vAlign=top align=middle bgColor=#f0e8c8

colSpan=7>Partition

info: PCQLinux 2004




bgColor=#f0e8c8> size=1>Device

bgColor=#f0e8c8> size=1>Boot

bgColor=#f0e8c8> size=1>Start

bgColor=#f0e8c8> size=1>End

bgColor=#f0e8c8> size=1>Blocks

bgColor=#f0e8c8> size=1>Id

bgColor=#f0e8c8> size=1>System



bgColor=#f0e8c8> size=1>/dev/hdc1

bgColor=#f0e8c8> size=1>*

x:num>1

x:num>13

x:num> size=1>104391

x:num>83

bgColor=#f0e8c8> size=1>Linux



bgColor=#f0e8c8> size=1>/dev/hdc2

bgColor=#f0e8c8> 

x:num>14

x:num>842

bgColor=#f0e8c8> size=1>6658942+

x:num>83

bgColor=#f0e8c8> size=1>Linux



bgColor=#f0e8c8> size=1>/dev/hdc3

bgColor=#f0e8c8> 

x:num>843

x:num>874

x:num> size=1>257040

x:num>82

bgColor=#f0e8c8>Linux

swap


Thus, an extended partition is created (/dev/hdc4),

and in this the three partitions of RedHat Enterprise

3.0 distro are installed. The boot partition is

installed in /dev/ hdc5, root partition in /dev/ hdc6

and swap partition in /dev/ hdc7. 



Now you need to know the kernel version and initrd

version for RedHat Enterprise 3.0 distro. For this, you

have to mount the boot partition which is installed in

/dev/hdc5. Run the following commands.



mount /dev/hdc5 /test

cd

test
cd boot

ls



Note the kernel and initrd version for RedHat

Enterprise 3.0 distro, which are vmlinuz-2.4.21-4.EL and
initrd-2.4.21-4.EL.img respectively. 



Now you need to configure the PCQLinux 2004 grub.conf

file. In this file, add the partition details of the

RedHat Enterprise 3.0. For this add the following four

lines in PCQLinux 2004 grub.conf file and save it.





  • title RED HAT ENTERPRISE LINUX

  • root (hd0,4)

  • kernel /vmlinuz-2.4.21-4.EL ro root=/dev/hdc6

  • initrd /initrd-2.4.21-4.EL.img


The boot partition of RedHat Enterprise is in

/dev/hdc5, so you have to write root (hd0,4) and the

root partition is in /dev/hdc6, hence root=/dev/hdc6.

Add the kernel version and initrd version you noted

above. 













vAlign=top align=middle bgColor=#787458>







vAlign=top align=middle bgColor=#f0e8c8

colSpan=7>Partition

info: PCQLInux 2004 and RedHat Enterprise

3.0




align=middle bgColor=#f0e8c8>

size=1>Device



bgColor=#f0e8c8> size=1>Boot

bgColor=#f0e8c8> size=1>Start

bgColor=#f0e8c8> size=1>End

bgColor=#f0e8c8> size=1>Blocks

bgColor=#f0e8c8> size=1>Id

bgColor=#f0e8c8> size=1>System



bgColor=#f0e8c8 x:str="/dev/hdc1 "> face=Verdana size=1>/dev/hdc1

bgColor=#f0e8c8> size=1>*

x:num>1

x:num>13

x:num> size=1>104391

x:num>83

bgColor=#f0e8c8> size=1>Linux



bgColor=#f0e8c8> size=1>/dev/hdc2

bgColor=#f0e8c8> 

x:num>14

x:num>842

bgColor=#f0e8c8> size=1>6658942+

x:num>83

bgColor=#f0e8c8> size=1>Linux



bgColor=#f0e8c8> size=1>/dev/hdc3

bgColor=#f0e8c8> 

x:num>843

x:num>874

x:num> size=1>257040

x:num>82

bgColor=#f0e8c8>Linux

swap




bgColor=#f0e8c8> size=1>/dev/hdc4

bgColor=#f0e8c8> 

x:num>875

x:num>1826

x:num> size=1>7646940

x:num>5

bgColor=#f0e8c8> size=1>Extended



bgColor=#f0e8c8> size=1>/dev/hdc5

bgColor=#f0e8c8> 

x:num>875

x:num>887

x:num> size=1>104391

x:num>83

bgColor=#f0e8c8> size=1>Linux



bgColor=#f0e8c8> size=1>/dev/hdc6

bgColor=#f0e8c8> 

x:num>888

x:num>1809

bgColor=#f0e8c8> size=1>7405933+

x:num>83

bgColor=#f0e8c8> size=1>Linux



bgColor=#f0e8c8> size=1>/dev/hdc7

bgColor=#f0e8c8> 

x:num>1810

x:num>1826

x:num> size=1>136521

x:num>82

bgColor=#f0e8c8>Linux

swap


Now, save the grub.conf file and reboot the system.

After this you will be able to boot both the Linux

distros.



The trick is that you configure only one grub.conf

file for the distro that is to be installed. This

grub.conf file should, however, have the details of the

three partitions of all the Linux distros you

install. 

Advertisment

Sourced from: PCQuest

tech-news