Page 1 of 1

Multi-booting with CentOS, Mandriva, and openSUSE

Posted: 2008/10/05 03:46:30
by oldwierdal
I've been messing with this problem for some time, now, and just when I think I have it figured out, I don't have it figured out at all.
I want to multi-boot several Linux distributions to test them, Since CentOS 5.2 is my primary system, it was installed first. Understandably, each succeeding distribution wants to install its own boot loader.
No problem, I think. I'll just edit the grub.conf or menu.lst in the new installation to allow for booting CentOS if I choose. Not so easy. I get error messages such as "wrong file type," or "wrong directory, or bad file type," or "missing file."
Here are the grub.conf or menu.lst files for the three distributions I'm working on;
First, CentOS 5.2
$ sudo cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda5
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title CentOS 5 hda3 (2.6.18-92.1.13.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.1.13.el5 ro root=/dev/hda3 rhgb quiet resume=/dev/hda2
initrd /initrd-2.6.18-92.1.13.el5.img

title CentOS 5 hda3 (2.6.18-92.1.10.el5.centos.plus)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.1.10.el5.centos.plus ro root=/dev/hda3 rhgb quiet resume=/dev/hda2
initrd /initrd-2.6.18-92.1.10.el5.centos.plus.img

title desktop586 2.6.24.4-1mnb
kernel (hd0,4)/vmlinuz-2.6.24.4-desktop586-1mnb BOOT_IMAGE=desktop586_2.6.24.4-1mnb root=UUID=8091cadb-f2fc-429d-abc8-da9adf4e6842 resume=/dev/hda2 splash=silent vga=788
initrd (hd0,0)/initrd-2.6.24.4-desktop586-1mnb.img

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.0 - 2.6.25.5-1.1
root (hd0,6)
kernel /boot/vmlinuz-2.6.25.5-1.1-pae root=/dev/disk/by-id/scsi-SATA_WDC_WD5000AVJB-_WD-WCAS87395101-part7 resume=/dev/sda2 splash=silent showopts vga=0x314
initrd /boot/initrd-2.6.25.5-1.1-pae

With this as the MBR, CentOS boots just fine, but neither Mandriva 2008.1, nor openSUSE 11.0 will boot. It seems to me that they should, but they won't.

Next, the Mandriva menu.lst;

$ sudo cat /hda5/boot/grub/menu.lst
timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,0)/gfxmenu
default 1

title desktop586 2.6.24.7-1mnb
kernel (hd0,0)/vmlinuz-2.6.24.7-desktop586-1mnb BOOT_IMAGE=desktop586_2.6.24.7-1mnb root=UUID=8091cadb-f2fc-429d-abc8-da9adf4e6842 resume=/dev/hda2 splash=silent vga=788
initrd (hd0,0)/initrd-2.6.24.7-desktop586-1mnb.img

title CentOS 5 hda3 (2.6.18-92.1.10.el5.centos.plus)
kernel (hd0,0)/vmlinuz-2.6.18-92.1.10.el5.centos.plus BOOT_IMAGE=CentOS_5_hda3_(2618-92110el5cen root=/dev/hda3 ro rhgb quiet resume=/dev/hda2
initrd (hd0,0)/initrd-2.6.18-92.1.10.el5.centos.plus.img

title desktop586 2.6.24.4-1mnb
kernel (hd0,0)/vmlinuz-2.6.24.4-desktop586-1mnb BOOT_IMAGE=desktop586_2.6.24.4-1mnb root=UUID=8091cadb-f2fc-429d-abc8-da9adf4e6842 resume=/dev/hda2 splash=silent vga=788
initrd (hd0,0)/initrd-2.6.24.4-desktop586-1mnb.img

Again, with this as the MBR, Mandriva will boot, but CentOS will not. At the time I was playing with this, I had not yet installed openSUSE, thus, no entry for it.

Now, the menu.lst for openSUSE;
$ sudo cat /hda7/boot/grub/menu.lst
# Modified by YaST2. Last modification on Sat Oct 4 18:55:48 UTC 2008
default 0
timeout 8
gfxmenu (hd0,6)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.0 - 2.6.25.5-1.1
root (hd0,6)
kernel /boot/vmlinuz-2.6.25.5-1.1-pae root=/dev/disk/by-id/scsi-SATA_WDC_WD5000AVJB-_WD-WCAS87395101-part7 resume=/dev/sda2 splash=silent showopts vga=0x314
initrd /boot/initrd-2.6.25.5-1.1-pae

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.0 - 2.6.25.5-1.1
root (hd0,6)
kernel /boot/vmlinuz-2.6.25.5-1.1-pae root=/dev/disk/by-id/scsi-SATA_WDC_WD5000AVJB-_WD-WCAS87395101-part7 showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off x11failsafe vga=0x314
initrd /boot/initrd-2.6.25.5-1.1-pae

###Don't change this comment - YaST2 identifier: Original name: CentOS 5 hda3 (2.6.18-92.1.13.el5) (/dev/sda5)###
title CentOS 5 hda3 (2.6.18-92.1.13.el5) (/dev/sda3)
root (hd0,2)
configfile /boot/grub/menu.lst

So,....... What am I missing, besides wealth, good looks, and common sense?

Thanks for any help with this.

owa :-?

Multi-booting with CentOS, Mandriva, and openSUSE

Posted: 2008/10/05 04:12:14
by toracat
Could you show us the output from [b]fdisk -l[/b] ? And where are the /boot and / of each OS located in terms of /dev/hdaX ?

Re: Multi-booting with CentOS, Mandriva, and openSUSE

Posted: 2008/10/05 10:55:20
by oldwierdal
Hi, toracat. Here is the output of fdisk -l.

$ sudo /sbin/fdisk -l

Disk /dev/hda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 268 2048287+ 82 Linux swap / Solaris
/dev/hda3 269 10467 81923467+ 83 Linux
/dev/hda4 10468 60801 404307855 5 Extended
/dev/hda5 10468 20194 78132096 83 Linux
/dev/hda6 20195 29921 78132096 83 Linux
/dev/hda7 29922 39648 78132096 83 Linux
/dev/hda8 39649 49375 78132096 83 Linux
/dev/hda9 49376 60801 91779313+ 83 Linux

Disk /dev/sdb: 1031 MB, 1031798784 bytes
16 heads, 32 sectors/track, 3936 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 3936 1007600 e W95 FAT16 (LBA)

Mandriva resides on /dev/hda5, and openSUSE resides on /dev/hda7. CentOS resides on /dev/hda3, with /dev/hda1 as /boot, and /dev/hda2 as swap for all. /dev/hda6 is used as a /home template. Once each distribution is installed, and users added, the /home directory is copied into the /root directory, and the corresponding mount point in fstab is commented out, so that /dev/hda6 is no longer mounted during boot.
As both Mandriva and openSUSE do some sort of linking between vmlinuz* and vmlinuz, and also between initrd.img and initrd*.img, I didn't want to mix either of their /boot directories with /boot-for-CentOS. So, I put both of their /boot directories in their respective / directories.
I initially had the Mandriva /boot sharing the CentOS /boot until I saw what was happening with their /boot and grub. That;s when I separated them. However, the problem was happening with Mandriva and CentOS before I separated them as well. As a result, openSUSE, when it was installed, had the /boot directory installed in the / directory right from the start.

The primary reason I chose to install directly onto a raw partition rather than to use VirtualBox or VMware was because of the actual hardware. I have found that a distribution might install and function seemingly ok in a virtual installation, but, when it is installed natively, that is, using actual hardware rather than the virtual hardware provided by the virtual host, the behavior can be quite different.

Thanks for your response,

owa :-)

Re: Multi-booting with CentOS, Mandriva, and openSUSE

Posted: 2008/10/05 15:07:28
by oldwierdal
To update, I managed to get Mandriva to boot using the /boot/grub/grub.conf from the CentOS as MBR. I copied all of the pertinent files from the boot and boot/grub directories on the Mandriva installation to boot and boot/grub directories on the CentOS installation, still using that as the MBR. I have NOT tried to install the Mandriva grub as the MBR. Nor have I done anything with the openSUSE installation.
So, for now, this is partially fixed. Although, I don't have a clue where the problem was or is, and I don't understand why deleting the Mandriva boot and grub files from the CentOS boot and grub, and then re-copying them back from the Mandriva boot and grub should have fixed as much as it did.
I'll post back with more as I progress. If anyone hase anything to add or contribute, it would be most welcome.

Thanks,
owa

Re: Multi-booting with CentOS, Mandriva, and openSUSE

Posted: 2008/10/05 16:54:44
by toracat
I have been looking at your grub.conf files. Because you put /boot from all 3 OSes in hda3, I would imagine you need to copy all the contents of /boot in there. I suppose you will eventually achieve what you are aiming at, but if I were to do the same task, I would create separate /boot for each OS. That's what I actually do when setting up a box with multiple versions of CentOS.

Re: Multi-booting with CentOS, Mandriva, and openSUSE

Posted: 2008/10/06 01:00:47
by oldwierdal
I did share the /boot ( /dev/hda1) with CentOS and Mandriva, but later separated them, with the boot directory residing in the / directory of each. Then, when I installed openSUSE, I did the same, placing boot within the / of openSUSE.
I have since copied the contents of all three boot directories to /boot (/dev/hda1), and edited the grub.conf and /etc/fstab for each appropriately. This is now the grub.conf of /boot/grub (/dev/hda1);
$ sudo cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda5
# initrd /initrd-version.img
#boot=/dev/sda
default=3
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title CentOS 5 hda3 (2.6.18-92.1.13.el5)
root (hd0,0)
kernel /boot-centos/vmlinuz-2.6.18-92.1.13.el5 ro root=/dev/hda3
rhgb quiet resume=/dev/hda2
initrd /boot-centos/initrd-2.6.18-92.1.13.el5.img

title CentOS 5 hda3 (2.6.18-92.1.10.el5.centos.plus)
root (hd0,0)
kernel /boot-centos/vmlinuz-2.6.18-92.1.10.el5.centos.plus ro
root=/dev/hda3 rhgb quiet resume=/dev/hda2
initrd /boot-centos/initrd-2.6.18-92.1.10.el5.centos.plus.img

title desktop586 2.6.24.4-1mnb
kernel (hd0,0)/boot-mandriva/vmlinuz-2.6.24.4-desktop586-1mnb
BOOT_IMAGE=desktop586_2.6.24.4-1mnb root=UUID=8091cadb-f2fc-429d-abc8-da9adf4e6842 resume=/dev/hda2 splash=silent vga=788
initrd (hd0,0)/boot-mandriva/initrd-2.6.24.4-desktop586-1mnb.img

title desktop586 2.6.24.7-1mnb
kernel (hd0,0)/boot-mandriva/vmlinuz-2.6.24.7-desktop586-1mnb
BOOT_IMAGE=desktop586_2.6.24.7-1mnb root=/dev/hda5 resume=/dev/hda2 splash=silent vga=788
initrd (hd0,0)/boot-mandriva/initrd-2.6.24.7-desktop586-1mnb.img

title desktop586 2.6.24.7-1mnb
kernel (hd0,0)/boot-mandriva/vmlinuz-2.6.24.7-desktop586-1mnb
BOOT_IMAGE=desktop586_2.6.24.7-1mnb root=UUID=8091cadb-f2fc-429d-abc8-da9adf4e6842 resume=/dev/hda2 splash=silent vga=788
initrd (hd0,0)/boot-mandriva/initrd-2.6.24.7-desktop586-1mnb.img

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.0 - 2.6.25.5-1.1
root (hd0,0)
kernel /boot-suse/vmlinuz-2.6.25.5-1.1-pae
root=/dev/disk/by-id/scsi-SATA_WDC_WD5000AVJB-_WD-WCAS87395101-part7 resume=/dev/sda2 splash=silent showopts vga=0x314
initrd /boot-suse/initrd-2.6.25.5-1.1-pae

As it stands, this works for both CentOS and Mandriva. OpenSUSE still complains about something being the wrong file type immediately after trying to launch vmlinuz-2.6.25.5-1.1.pae, before it even tries to launch initrd. This problem with openSUSE happens whenever I've tried to install it. The install goes just fine, a clean install, and I get it configured and everything seems ok. When I reboot to CentOS, that goes ok. Then, when I want to go back to openSUSE, it refuses to boot past vmlinuz. This is the third time I've tried with openSUSE, with the same results.
Mandriva and CentOS play together nicely. I just might turn openSUSE into free electrons and consider it not worth the effort.

Mandriva 2008 Spring, by the way, is the best I've seen from Mandrake, now Mandriva. The installer might actually be better, in my opinion, than Anaconda this time out. For the five years that I've been playing with various Linux distributions, I've always believed that Anaconda was by far the superior installer. Now, the Mandriva installer will give Anaconda a serious challenge, I think.

I'll test drive Mandriva 2008.1 for a while and see what time and updates do to or for it. However, I'll keep my trusty workhorse, CentOS 5.2 up to date, and ready to use if and when Mandriva 2008.1 goes lame.

Thanks for your help and advice, toracat. It is much appreciated.

owa :lol: