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 configure multiple Linux booting in one PC.
Here's output of "fdisk -l"
Code:
Device Boot Start End Blocks Id System
/dev/hda1 * 1 2040 16386268+ c W95 FAT32 (LBA)
/dev/hda2 2041 7361 42740932+ f W95 Ext'd (LBA)
/dev/hda3 7362 9730 19021824 83 Linux
/dev/hda5 2041 2693 5245191 83 Linux
/dev/hda6 2694 4733 16386268+ 83 Linux
/dev/hda7 4734 4929 1574338+ 82 Linux swap / Solaris
/dev/hda8 4930 7361 19535008+ 83 Linux
I've installed RHEL5 on /dev/hda6 & it's Grub on /dev/hda5 (/boot).
I want to add other Linuxes on other partitions & boot them using RHEL5's grub.
So, I've installed Fedora_16 on /dev/hda3, without installing it's grub.
Then added some "chainloader +1" rules in /etc/grub.conf:
Quote:
title Red Hat Enterprise Linux Server (2.6.18-8.el5)
root (hd0,4)
kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.18-8.el5.img
title Windows
rootnoverify (hd0,0)
chainloader +1 title Fedora_16 (Verne)
root (hd0,2)
chainloader +1
grub can write its own grub.cfg Make sure all partitions are mounted
In a terminal do:
sudo update-grub (takes a while, especially as you have a lot of partitions)
I am no expert, but I've never seen chainloader +1 in a Linux grub.cfg entry, except for Windows.
Typical entry for Fedora, which you can find in (Fedora partition) /boot/grub2/grub.cfg
menuentry 'Fedora (3.5.2-1.fc17.x86_64)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-710cdbf5-48ff-484d-b1f8-9a143a78dbec' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6' 710cdbf5-48ff-484d-b1f8-9a143a78dbec
else
search --no-floppy --fs-uuid --set=root 710cdbf5-48ff-484d-b1f8-9a143a78dbec
fi
echo 'Loading Fedora (3.5.2-1.fc17.x86_64)'
linux /boot/vmlinuz-3.5.2-1.fc17.x86_64 root=UUID=710cdbf5-48ff-484d-b1f8-9a143a78dbec ro rd.md=0 rd.lvm=0 rd.dm=0 SYSFONT=True KEYTABLE=us rd.luks=0 LANG=en_US.UTF-8 rhgb quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-3.5.2-1.fc17.x86_64.img
}
The problem I see for you is: I have Ubuntu and Fedora. Ubuntu has 'control' of grub at boot. So if it adds a kernel, it does update-grub, which overwrites past entries. I don't usually have both partitions mounted, so it does not find Fedora. After a kernel update, I need to a) mount the Fedora partition b) run sudo update-grub
I would like to know how to automate this. For you it is even more important.
RHEL 5 uses Grub, not Grub2, so your script won't work here, Pedroski.
@cOde13: If you want to chainload a Linux system you must install its bootloader to its root partition. Chainloading means that one bootloader starts the next one, which of course can't work if you don't have one installed.
.........
@cOde13: If you want to chainload a Linux system you must install its bootloader to its root partition. Chainloading means that one bootloader starts the next one, which of course can't work if you don't have one installed.
It asked me to install Grub in /dev/hda ; can't recall if it asked for installing on particular partition. But I'll try and post here the result.
Is it possible to install Fedora's Grub to it's root partition using "linux rescue"? or, I need to reinstall Fedora?
I did mention I am no expert! It is not my script, it comes with Linux. I could not write that.
But: I could chainload Fedora from the Ubuntu boot grub.cfg??? Point it at (Fedora partition)/boot/grub2/grub.cfg or how??
Can you tell me what the entry should look like?? That would save me updating Ubuntu grub.cfg every time.
To chainload Fedora you have to install the bootlaoder to fedoras root partition. You don't point it to Fedoras boot config, but to the partition, where Fedoras Grub takes over, reading the config. Since I haven't used Grub (and especially Grub2) for a long tme I can't help you with the config.
Distribution: Deb, Mint, Slack, LFS, Fedora, Ubuntu(LXDE)
Posts: 71
Rep:
Not necessarily applicable to this case but - I've normally run 4 to 5 different systems at a time, usually with Deb as prime and Deb grub booting all, no chain except Win. With earlier versions of update-grub, it would create an incorrect entry for Fedora because the boot img file in Fedora was a different name format and unrecognized, causing a boot entry with no img file. Had to manually add it to grub.cfg.
I suspect this would not be the case with only Red Hat and Fedora since I ASSUME they would have the same construction and a Red Hat grub should correctly handle a Fedora construct.
Then you will have the same problem as me: update the Deb kernel, and you will wipe out your grub.cfg entries, unless you have all partitions mounted at the time. Why would you do that?
Seems to me chainloading is a good idea for multiple boot systems. Just gotta figure out how to formulate the entries in grub.cfg and the problem of the bootloader. I'm sure I told Fedora not to install the boot loader, as that would wipe out my Ubuntu grub.
Distribution: Deb, Mint, Slack, LFS, Fedora, Ubuntu(LXDE)
Posts: 71
Rep:
No, that is not the case. When the new Deb kernel installs and updates grub.cfg, it reads the entire disk for OS's and adds them. They don't have to be mounted. The only problem is when it doesn't properly recognize the particular set-up and this is pretty much solved now.
Also, with more current grub installs, if you need to do anything special or manual, you can sudo edit /etc/grub.d/40_custom and add any menu entry you like. When grub updates, it will add anything it finds there to grub.cfg. This could specific boot items or even just a message/reminder to yourself.
You're lucky! If my Fedora partition is not mounted, Ubuntu does not see it. Actually, I've never had it mounted during a kernel update. Next time I'll try.
Yes, I am with TobiSGD on this. In order to multiboot Linux you put one Linux Grub (or Lilo) in the MBR and any other Linux you want to multiboot, you'll have to put its bootloader IN HIS OWN ROOT PARTITION otherwise poor grub can't recognize the linux you want to boot when you start your system. I have a multiboot system with 12 Linux,Opensolaris, PCBSD and WINXP with that simple system and everything is working like a charm.Simple system, simple solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.