Google

2005-05-29

Dual booting Fedora and Mandriva

Last weekend I've downloaded both Mandriva 2005 LE DVD and Fedora Core 3 DVD and installed them on my spare pc. Problem was that I only had 1 SCSI HD and when I installed the second Linux distibution, its loader did not recognize the other one. So, below is how I tinkered with grub and finally made it work in anyway I wanted.

I posted an e-mail to Mandriva expert group and asked for help. Someone extended his handed and suggested that I copy Mandriva boot files into Fedora boot partition and add an entry for it in the grub. I did it and it worked.

Below is from my e-mail to the grup but note that boot loader application 'grub' does not care if you have an ide or scsi. First harddrive will be shown as hd0 (not as sd0 as one might expect).

-----------------------------------------
[root@ahlnx ~] fdisk -l

Disk /dev/sda: 36.4 GB, 36420075520 bytes
255 heads, 63 sectors/track, 4427 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Cap. Id System Holds
----------------------------------------------------------------
/dev/sda1 300MB 83 Linux (Mandriva /boot)
/dev/sda2 12.5GB 5 Extended
/dev/sda3 100MB 83 Linux (Fedora /boot)
/dev/sda4 22.5GB 8e Linux LVM (Fedora /)
/dev/sda5 2.0GB 82 Linux swap
/dev/sda6 10.0GB 83 Linux (Mandriva /)

First I mounted /dev/sda1 - where my current Mandriva boot images are
hold - to Fedora & copied everything under it to /boot/Mandriva:

mkdir /mnt/bootMandriva
mount /dev/sda1 /mnt/bootMandriva
cd /mnt/bootMandriva
rsync -va . /boot/Mandriva

Then, I added these lines in /etc/grub.conf
title Mandrive 2005
root (hd0,2)
kernel /Mandriva/vmlinuz-2.6.11-6mdksmp ro root=/dev/sda6
initrd /Mandriva/initrd-2.6.11-6mdksmp.img

Happy ending, eh? Well, not so quick...Once I got on to Mandriva, I
could not go back to Fedora as it did not know anything about Fedora!

So, I tried the same approach by mounting fedora boot partion /dev/sda3
to Mandriva and adding an entry to /etc/lilo.conf after copying 3 files
that I thought would do the trick:
config-2.6.11-1.27_FC3smp
initrd-2.6.11-1.27_FC3smp.img
vmlinuz-2.6.11-1.27_FC3smp
System.map-2.6.11-1.27_FC3smp

Unfortunately I got errors during boot...

I'll keep on troubleshooting this as it serves as a good learning
practice for me. For the time being, I loaded grub back (to MBR):

[root@ahlnx ~] grub
[root@ahlnx ~] grub> root (hd0,2)
[root@ahlnx ~] grub> setup (hd0)
[root@ahlnx ~] grub> quit

root (hd0,2) tells grub that my boot partition is /dev/sda3
setup (hd0) loads grub into MBR (Master Boot Record) so that it will run next time I boot.

After rebooting, I am back to Fedora.
-----------------------------------------

Well, actually after a little bit more digging, I realized that I did not need to copy boot files from the linux boot partition at all. So, I added the following entry into /etc/grub.conf on Fedora's boot sector (/dev/sda3)

title Mandriva 2005 (From /dev/sda1)
root (hd0,0)
kernel /vmlinuz ro root=/dev/sda6
initrd /initrd.img
And just to prove it to myself that I could it do the same from Mandriva side, I added the following entry into /boot/grub/menu.lst on Mandriva's boot sector (/dev/sda1)

title Fedora (Boot from Fedora /boot)
kernel (hd0,2)/vmlinuz-2.6.11-1.27_FC3smp root=/dev/VolGroup00/LogVol00
initrd (hd0,2)/initrd-2.6.11-1.27_FC3smp.img

The interesting thing is the part which reads root=/dev/VolGroup00/LogVol00
This notation seems to be specific to my installation and Grub. Lilo does not recognize it as a valid root (/) partition.

No comments: