Managing Multiple Linux Operating Systems

How many operating system do you have on your system

  • Two

    Votes: 0 0.0%
  • Three

    Votes: 0 0.0%
  • Four

    Votes: 0 0.0%
  • More than Four

    Votes: 0 0.0%

  • Total voters
    244
Status
Not open for further replies.

paragkalra

The Linux Man !
How to manage multiple Linux operating systems on your machine along with Windows XP and Macintosh tiger -x86.
I guess most us of install first operating systems as Windows . People who love Linux goes one step ahead, they install Linux operating system as well over Windows. Till you just install one operating system and that too Windows XP, the boot loader of your system belongs to Windows XP and in case you want to edit some thing like display title during booting or time during which boot menu should be displayed etc, then you are suppose to edit the file boot.ini found in C:/ (booting drive). But when you install Linux over Windows XP, the boot loader of Linux overwrites boot loader of Windows XP and thats the result boot menu changes after you install Linux over Windows XP. In this case if you want to edit some thing in boot menu like default operating system, time during which the boot menu should be displayed etc then you are supposed to edit file called grub.conf (grub.conf in case of RedHat and Fedora where as file menu.lst in case of Suse). These files are present /boot/grub/. You can edit these files using vi editor. Do something like vi /boot/grub/grub.conf (for RedHat and Fedora) or vi /boo/grub/menu.lst (for Suse). As long as your machine is just having any one Linux and Windows XP you are not suppose to edit these files. But moment you install any second Linux operating like Suse over RedHat or Fedora over RedHat or Suse over Fedora etc then boot loader of second Linux overwrites boot loader of first Linux keeping your Windows XP intact. Thus in boot menu you would be given option to choose either new Linux or Windows XP but not the first Linux which you installed over Windows XP. Where is first Linux which you installed over Windows XP. Does it mean that all data which you stored in first Linux is lost. Relax buddy have a chill pill. I am there to help you out. Thus bottom line is that when you install one operating system over the other, the boot loader of second operating system overwrites boot loader of first operating system. Whether you would get the choice to select first operating system depends on second operating system. If second operating system edits its boot menu file on its own then no quarrels. But in case it doesn't then keep on reading this article.
I first installed Macintosh tiger -x86 on my machine. Then I installed Windows XP. It meant boot loader of Windows XP overwrote boot loader of Macintosh tiger-x86. When system rebooted I was not presented the option to select Mac. Then I installed Fedora core 4. Here boot loader of Fedora core 4 overwrote boot loader of boot loader of Windows XP. However in boot menu I was presented the option to select the either Windows XP or Fedora Core 4. This is because Fedora core updated its boot menu file grub.conf and made an entry of Window XP. Now you might wonder why it left out Mac. The answer is simple it depends on kernel that which operating system should it allow automatically in boot menu depending upon the file system. Then I installed RHEL 4 (completely graphical). Here boot loader of RHEL 4 overwrote boot loader of Fedora Core 4. In boot menu I had to choose between RHEL 4 and Windows XP. Then I installed Suse 10. As an hard and fast rule boot loader of Suse 10 overwrote the boot loader of RHEL 4 (completely graphical). However to my suprise boot menu of Suse 10 allowed me to choose any one of following operating systems:
Windows XP
Suse 10
Fedora Core 4
RHEL 4
However Mac was still in no picture. Then I installed again RHEL 4 (minimal installation – completely text). As usual boot loader of RHEL 4 (minimal installation – completely text) overwrote boot loader of Suse 10. As expected boot menu contained only Windows XP and RHEL 4 (minimal installation – completely text based)
Now my aim was publishing all six operating systems in one boot menu. I logged into RHEL 4 (minimal installation – completely text). I checked its boot menu file grub.conf (using vi /boot/grub/grub.conf). It showed me some like this:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,8)
# kernel /boot/vmlinuz-version ro root=/dev/hda9
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=5
#splashimage=(hd0,8)/boot/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux WS (2.6.9-5.EL)
root (hd0,8)
kernel /boot/vmlinuz-2.6.9-5.EL ro root=/dev/hda9
initrd /boot/initrd-2.6.9-5.EL.img

title windows XP
rootnoverify (hd0,1)
chainloader +1

Here we get our first answer. The final boot menu of RHEL 4 (minimal installation – completely text based) showed just two operating systems because only those two operating systems were listed in grub.conf. So to bring other operating systems into picture as well we will have to make their entries in grub.conf file. Now how to find which text belongs to which operating systems because unlike our first case we can't login to other operating systems to read grub.conf file. No probs use the following command in termainl:

{#fdisk /dev/hda }

You would see something like this:

The number of cylinders for this disk is set to 9730.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):

{ Here press p as shown bellow and then press enter}

You would see something like this:

The number of cylinders for this disk is set to 9730.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

{ Now you would see some thing like this}

disk /dev/hda: 80.0 GB, 80032038912 bytes
255 heads, 63 sectors/track, 9730 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 784 6290896+ af Unknown
/dev/hda2 * 785 2824 16386300 7 HPFS/NTFS
/dev/hda3 2825 7760 39648420 5 Extended
/dev/hda4 7761 9048 10345860 83 Linux
/dev/hda5 2825 4609 14337981 b W95 FAT32
/dev/hda6 4610 5871 10136983+ 83 Linux
/dev/hda7 5872 6001 1044193+ 82 Linux swap / Solaris
/dev/hda8 6002 7148 9213246 83 Linux
/dev/hda9 7149 7275 1020096 83 Linux
/dev/hda10 7276 7543 2152678+ 8e Linux LVM
/dev/hda11 7544 7575 257008+ 82 Linux swap / Solaris

Command (m for help):

{Now it is hard to determine which partition belongs to which operating system. So during installation of multiple operating systems make sure that no two operating systems have same size of partitions. In my case you can make out that no two operating systems are having same size. Hence I know which partition belongs to which operating system. For your convenience let me tell you my operating systems and their corresponding partitions:

Macintosh --> /dev/hda1
Windows XP --> /dev/hda2
Fedora Core 4 --> /dev/hda4
RHEL 4 (completely graphical) --> /dev/hda8
Suse 10 --> /dev/hda6
RHEL 4 (minimal installation-completely text based) --> /dev/hda9

The next thing I did was to mount each and every respective partition one by one and note down the corresponding boot menu entry. To begin with I first mounted /dev/hda4 which is my Fedora partition. I did some like this:}

#mount /dev/hda4 /mnt
#vi /mnt/boot/grub/menu.lst

{I copied Fedora core entry from it and pasted it in grub.conf of RHEL 4 (text-based). I did same thing to each and every partition except Mac i.e. first copied the respective os entry and pasted it to grub.conf of RHEL 4 (text-based). The grub.conf of RHEL 4 (text-based) at this stage looked something like this.}

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,8)
# kernel /boot/vmlinuz-version ro root=/dev/hda9
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=5
#splashimage=(hd0,8)/boot/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux WS (2.6.9-5.EL)
root (hd0,8)
kernel /boot/vmlinuz-2.6.9-5.EL ro root=/dev/hda9
initrd /boot/initrd-2.6.9-5.EL.img

title windows XP
rootnoverify (hd0,1)
chainloader +1

title Suse 10
root (hd0,5)
kernel /boot/vmlinuz root=/dev/hda6
initrd /boot/initrd

title RHEL 4
root (hd0,7)
kernel /boot/vmlinuz-2.6.9-5.EL ro root=/dev/hda8
initrd /boot/initrd-2.6.9-5.EL.img

title Fedora Core (2.6.11-1.1369_FC4)
root (hd0,3)
kernel /boot/vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/dev/hda4
initrd /boot/initrd-2.6.11-1.1369_FC4.img

{Here Mac entry is missing and rightly so. Its not a Linux so it deserves a different treatment. For Mac make following entry}

title Mac OS tiger x86
rootnoverify (hd0,0)
chainloader +1

{ The final grub.conf looked some thing like this}

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,8)
# kernel /boot/vmlinuz-version ro root=/dev/hda9
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=5
#splashimage=(hd0,8)/boot/grub/splash.xpm.gz
hiddenmenu

title Red Hat Enterprise Linux WS (2.6.9-5.EL)
root (hd0,8)
kernel /boot/vmlinuz-2.6.9-5.EL ro root=/dev/hda9
initrd /boot/initrd-2.6.9-5.EL.img

title windows XP
rootnoverify (hd0,1)
chainloader +1

title Suse 10
root (hd0,5)
kernel /boot/vmlinuz root=/dev/hda6
initrd /boot/initrd

title RHEL 4
root (hd0,7)
kernel /boot/vmlinuz-2.6.9-5.EL ro root=/dev/hda8
initrd /boot/initrd-2.6.9-5.EL.img

title Mac OS tiger x86
rootnoverify (hd0,0)
chainloader +1

title Fedora Core (2.6.11-1.1369_FC4)
root (hd0,3)
kernel /boot/vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/dev/hda4
initrd /boot/initrd-2.6.11-1.1369_FC4.img

{Now reboot the system and you would see all operating systems listed in boot menu. It may so happen that on selecting a particular OS you may not get into it. To avoid this make sure that the entry root (hdx,y) follows the following rule:
x=0 and y is always less than corresponding partition no by 1. Take for instance RHEL 4 (text based). Its entry is root (hd0,8) and its partion number is 9 (/dev/hda9) and as we all know 8 is less than 9 by 1. This rule obeys for each and every os in our case. You can check yourself. In case you have multiple hard disks x will no longer be zero. Lets not enter into that complexity at this stage. If every thing goes well you would be able to login into each and every operating system. You can select any operating system as your default operating system meaning that you can select which os should get booted in case you don't make any selection. At the top, there is one entry like default=1. Here entry 1 made Windows XP as my default operating system. In case you want Suse as your default os make default=2. Thus value of z for default=z depends on the position of your OS in grub.conf which you want to make default. Suppose it lies at 6 position in grub.conf then value of z would be 5 i.e one less than its positon in grub.conf. Also you can change the time during which boot menu should be displayed by editing timeout=5. Here it means that menu would be displayed for 5 seconds. In case you want to change it 10 seconds. Make it default=10
Best of Luck..........
Cheers...... :) :) :) :)
Parag Kalra

If you have any queries, send them to paragkalra@gmail.com }
 
Status
Not open for further replies.
Top Bottom