Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to triple boot my system with CentOS, winXP and Fedora. I'm using grub as my boot loader. I am able to bring up both winxp and CentOS. I just installed Fedoracore 6 and I installed it without a boot loader. I was hoping to be able to use grub. Fedora is installed on the same disk and the vmlinuz and initrd image are under /dev/sda8. Is there a way for me to configure grub.conf in my centoOS boot loader to load my fedora?
mount /dev/sda8 /mnt/fedora :
[root@prin ~]# cd /mnt/fedora/
[root@prin fedora]# ls
bin boot dev etc home lib lost+found media misc mnt opt proc root sbin selinux srv sys tmp usr var
[root@prin fedora]# ls boot
config-2.6.18-1.2798.fc6xen initrd-2.6.18-1.2798.fc6xen.img System.map-2.6.18-1.2798.fc6xen xen.gz-2.6.18-1.2798.fc6
grub symvers-2.6.18-1.2798.fc6xen.gz vmlinuz-2.6.18-1.2798.fc6xen xen-syms-2.6.18-1.2798.fc6
[root@prin fedora]#
I'm trying to triple boot my system with CentOS, winXP and Fedora. I'm using grub as my boot loader. I am able to bring up both winxp and CentOS. I just installed Fedoracore 6 and I installed it without a boot loader. I was hoping to be able to use grub. Fedora is installed on the same disk and the vmlinuz and initrd image are under /dev/sda8. Is there a way for me to configure grub.conf in my centoOS boot loader to load my fedora?
mount /dev/sda8 /mnt/fedora :
[root@prin ~]# cd /mnt/fedora/
[root@prin fedora]# ls
bin boot dev etc home lib lost+found media misc mnt opt proc root sbin selinux srv sys tmp usr var
[root@prin fedora]# ls boot
config-2.6.18-1.2798.fc6xen initrd-2.6.18-1.2798.fc6xen.img System.map-2.6.18-1.2798.fc6xen xen.gz-2.6.18-1.2798.fc6
grub symvers-2.6.18-1.2798.fc6xen.gz vmlinuz-2.6.18-1.2798.fc6xen xen-syms-2.6.18-1.2798.fc6
[root@prin fedora]#
Thanks!
Add entry to your centos /boot/grub/menu.lst file
(assuming sda is your primary drive)
Code:
title Fedora Core 6
root (hd0,7)
kernel /boot/vmlinuz-2.6.18-1-2798.fc6xen
initrd /boot/initrd-2.6.18-1.2798.fc6xen.img
Thanks for the quick reply. I updated my menu.lst file as you suggested. Here's my grub.conf:
[root@prin ~]# cat /etc/grub.conf
# 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,2)
# kernel /boot/vmlinuz-version ro root=/dev/sda3
# initrd /boot/initrd-version.img
#boot=/dev/sda3
default=0
timeout=10
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS-4 x86_64 (2.6.9-42.ELsmp)
root (hd0,2)
kernel /boot/vmlinuz-2.6.9-42.ELsmp ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.9-42.ELsmp.img
title CentOS-4 x86_64-up (2.6.9-42.EL)
root (hd0,2)
kernel /boot/vmlinuz-2.6.9-42.EL ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.9-42.EL.img
title WinXP_32bit
rootnoverify (hd0,1)
chainloader +1
title Fedoracore-6 x86_i386_32bit
root (hd0,7)
kernel /boot/vmlinuz-2.6.18-1.2798.fc6xen root=/dev/sda8
initrd /boot/initrd-2.6.18-1.2798.fc6xen.img
Now it seems it see's the image but doesn't recognize the format...Here's my error message:
Root (hd0,7)
Filesystem type is ext2fs, partition type 0x83
kernel /boot/vmlinuz-2.6.18-1.2798.fc6xen root=dev/sda8
Error 13: Invalid or unsupported executable format
Just a stab in the dark--is the presence of Xen relevant? eg, what are these files (from the first post)?
xen.gz-2.6.18-1.2798.fc6
symvers-2.6.18-1.2798.fc6xen.gz
xen-syms-2.6.18-1.2798.fc6
If those lines work use them in menu.lst but add the "title" statement at the beginning to identify the distro.
In manual booting you can repeat the command as Grub seldom hangs.
Also to avoid typing mistakes you can let Grub help you by say in the 2nd line I would just type the first part as
Code:
kernel /boot/vm
then follow by the tap key and Grub will find a file (or files) that can match it. If there is no other choice Grub will complete the kernel name for you.
The read only parameter "ro" can prevent user from accidentally damaging the setting.
Just a stab in the dark--is the presence of Xen relevant? eg, what are these files (from the first post)?
xen.gz-2.6.18-1.2798.fc6
symvers-2.6.18-1.2798.fc6xen.gz
xen-syms-2.6.18-1.2798.fc6
I just installed the full distro and those files were in there already. Not sure for what reason.
Saikee,
I did as you said and it fails to recognize the kernel /boot/vmlinuz-2.6.18-1.2798.fc6xen root=/dev/sda8 ro
and gives the same error invalid executable. Is it possible I'm using the wrong vmlinuz file? I can't imagine how it can be corrupted...
What you may need to do is reinstall and let Fedora be the owner of grub. You now know the correct entries for your other systems, so this is minimum risk. (After Fedora is up and running, edit the grub config file to add others)
Here is one reason I suggest this---from my Redhat setup:
Code:
title Red Hat Enterprise Linux WS (2.6.9-42.0.3.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.6.9-42.0.3.ELsmp ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.9-42.0.3.ELsmp.img
Note the use of the LABEL=/1 instead of the more usual /dev/something. I don't know how volume labels work, but I do know that Redhat has been criticized for the practice.....
I'm pretty sure your solution will work Pixellany, I was just trying to avoid reinstall . I hope the problem is not with hardware saikee because the installation went through seemlessly...I'll work on it again tomorrow and update you. Meanwhile, keep me posted as well. Thanks!
We are doing the standard Linux stuff but the Red Hat family has a dead wish to use label for locating the partition instead of using the raw device name as every other Linux does. You can find the labels if you run cfdisk and/or fdisk as they got displayed there.
My gut feeling is that you may have allowed Fedora slip in a LVM for you in which case I don't know how to get you out as I have been trying to avoid this damn thing. A LVM is a system combining several partitions together. It may be the best thing since slice bread but Grub doesn't see it and so a separate /boot partition must be created to boot the kernel first and let the kernel deals with the LVM. A standard Fedora automatic installation will create a LVM for you and thus using labels becomes logical.
If you haven't got a LVM then amend /etc/fstab and replace the lable name there with the raw device name /dev/sda8 for the "/" could get the system booted. I have done it a few times. I wish the distros would only make life simpler for the general users and stick with the general Linux standard.
If you stick with LVM you can forget multi-booting. The two do not mix.
So here's the solution that worked for me. I uninstalled Fedora and reinstalled it. This time I created a /boot (thanks Saikee/Pixellany)and I also installed a new boot loader (NOT indexed in the MBR). Fedora asked if there were other OS's I'd like visible in grub and and specified Winxp (sda1) and CentOS (sda2). So it worked. I logged in to my centOS and changed the default OS to Fedora, which I knew was properly configured to load the other OS's. Here is how my menu.lst file looks in Fedora now:
default=1
timeout=10
splashimage=(hd0,7)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,7)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.18-1.2798.fc6.img
title WinXP_Professional_32-bit
rootnoverify (hd0,1)
chainloader +1
title CentOS-4_x86_64-bit
rootnoverify (hd0,2)
chainloader +1
Notice the CentOS settings in grub.conf -- I wonder if I could've gotten away with setting just the chainloader for Fedora before I reinstalled? Anyways, thanks for all your help!
Glad to hear you finally got it even after a second installation.
Just two points for your information
(1) rootnoverify is for Grub booting a foreign system and hence no need to "verify" the partition. Modern Grub don't need to be told to do it but in general for a fellow Linux we use "root" instead of "rootnoverify".
(2) The Grub sitting in the MBR must boot one Linux directly by calling its kernel (vmlinuz...) and ramdisk file (inird...) names and can boot all other systems by chain loading. In chain loading one boot loader boots another. In your case you let Fedora's Grub to boot CentOS boot loader. You "WILL NOT" be able to ask Fedora's Grub to chain load itself. This is like a dog chasing its own tail in a never ending loop. Hope you are clear on this but you can have a go if you don't believe in what I say.
If you think of it everything in LInux is logical. If there is something it can't do it is usually for a good reason.
Thanks for the clarification Saikee. I still wonder, because my centos was loading fine maybe if I set chainloading for Fedora it would load the Fedora...well I guess we won't until this issue arises for me again
Yes you can ask CentOS to chain load Fedora. The only step needed is Fedora must have it boot loader in its root partition (in additional to MBR). You can arrange it anywhere (in CentOS or Fedora) by invoking a Grub shell as follow
Code:
grub
root (hd0,7)
setup (hd0,7)
quit
The above instructs Grub to "source" the Grub boot loader in the partition (hd0,7) and set itself up at the boot sector there.
Thereafter inside the menu.lst of CentOS you can make Fedora booted by adding these lines
Code:
title My Fedora in LABEL=/1
root (hd0,7)
chainloader +1
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.