LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Triple-boot Linux distros - how and where to install GRUB2? (https://www.linuxquestions.org/questions/linux-general-1/triple-boot-linux-distros-how-and-where-to-install-grub2-917813/)

Bernt.Ribbum 12-08-2011 07:25 PM

Triple-boot Linux distros - how and where to install GRUB2?
 
This is my Scenario!

Live CD Ubuntu 11.04
Live CD Mint 11.10
Live CD SuSE Gnome 11.4

I would like to have each of them boot from a partition on my HD, easily configurable. I boot all distros OK now, but configuration is a pain. For example, If I type "sudo grub-install /dev/sda" from Mint all is OK, but I thought an "update-grub" should do it. I just don't know enough. So, pretty easy questions for those who do:

* When I install from a live CD, where should I place the boot loader in each case? In my case, I've always said "/dev/sda", and it works but is troublesome.

* If I install each boot loader to the actual partition I'm installing the distro to, there should be (afaik) one "main" boot loader at /dev/sda, and chainloading to the others!?! How does this work, and how can I install that?

Thanks for any help!

- Bernt

syg00 12-08-2011 08:32 PM

I prefer to have one system with a separate /boot partition and that "owns" the MBR. All other systems are installed into their respective root partition. Generally an update-grub will find all the other kernels and build a boot menu o.k for you - just re-run it (on the MBR "owning" system) after each new install. No need to chainload.
Note that update-grub is a "Debian-ism" and wasn't shipped as standard in (classic) grub. The devs for grub2 included much of their Debian heritage.

Update-grub rebuilds grub.cfg, not the boot code.

Knightron 12-09-2011 05:55 AM

Hey mate, i personally have a grub legacy partition which is installed at sda1, which chainloads each of my distos which have there bootloaders at there root. This setup is perfect for me, but may be complicated for fresh noob (for the record i still classify my self as a noob but maybe not as quite as fresh as you). I would think that installing to the mbr which would be /dev/sda would be fine for your setup. You say you have issues with this. Mind me asking what the issues are? you may just not be dealing with it right.

Bernt.Ribbum 12-09-2011 10:02 AM

Quote:

Originally Posted by Knightron (Post 4545783)
Hey mate, i personally have a grub legacy partition which is installed at sda1, which chainloads each of my distos which have there bootloaders at there root. This setup is perfect for me, but may be complicated for fresh noob (for the record i still classify my self as a noob but maybe not as quite as fresh as you). I would think that installing to the mbr which would be /dev/sda would be fine for your setup. You say you have issues with this. Mind me asking what the issues are? you may just not be dealing with it right.

Knightron,
I do consider myself a NOOB, but I have used Linux for many years already. Unfortunately I've been in a rather serious accident, so I forget things quickly. But I want to have my machines running a wonderful operating system! The problem I have is that update-grub does not automatically add new kernels to the boot menu, but grub-install does. syg00 also gave advise - I'll try and see what I get.

Thanks for the reply - I'm right now running a fresh Mint install that was installed without touching the MBR, and it works. I had to redo "grub-install" in my "MBR-owner" to get to Mint though. What happens when I install even more distros I'll just have to see though. But I'll get there!

- Bernt

LinuxCounter registered user #93216.
Lenovo Thinkpad T500, HP Mini 110
Ubuntu 11.04, Mint 11, SuSE Gnome 11.4

Larry Webb 12-09-2011 02:22 PM

I have a separate boot partition and chainload my distros. I do not update my kernels, I clean partition and do new installs for all upgrades. I use grub2 and direct grub to install to the root on all my distros. This still should work for you by doing an update-grub on the distro. This way I do not have to change my menuentry for each upgrade. My menuentry reads "Suse" or "Ubuntu" and so forth. I do indicate the partition in the menu at the end of the name to make it easier to remember the partition numbers.

I will advise first planning out and making all your partitions first, that way there will be less of a chance of uuid and mapping problems.

Knightron 12-09-2011 05:18 PM

Ubuntu, Mint, Suse. These are the three distros you use. I'm pretty sure all three of these use grub2, but i may be wrong with suse. If it doesn't use grub2, and uses grub legacy then the command 'update grub' won't work.
This setup you may not like and there are alternatives, but it's probably the easiest. do a reinstall of each, the first distro you install, install it to mbr, then with any other distro you install after that, install to it's /. If you choose to use this method, on boot you will see two grub menus, first you'll see the mbr grub, then you'll select the distro, then it's grub will boot and you may choose any kernel you've loaded, (assuming you've updated grub on that partition). You will have to go into the first distro and 'update grub' to see the new kernels at the first menu. This post probably doesn't do this setup much justice, but i used to do this, with lilo at the mbr and it was very easy to manage and not as complicated as this post may make it sound.

Bernt.Ribbum 12-09-2011 06:06 PM

Quote:

Originally Posted by Knightron (Post 4546235)
Ubuntu, Mint, Suse. These are the three distros you use. I'm pretty sure all three of these use grub2, but i may be wrong with suse. If it doesn't use grub2, and uses grub legacy then the command 'update grub' won't work.
This setup you may not like and there are alternatives, but it's probably the easiest. do a reinstall of each, the first distro you install, install it to mbr, then with any other distro you install after that, install to it's /. If you choose to use this method, on boot you will see two grub menus, first you'll see the mbr grub, then you'll select the distro, then it's grub will boot and you may choose any kernel you've loaded, (assuming you've updated grub on that partition). You will have to go into the first distro and 'update grub' to see the new kernels at the first menu. This post probably doesn't do this setup much justice, but i used to do this, with lilo at the mbr and it was very easy to manage and not as complicated as this post may make it sound.

Thanks for a great reply! My own thoughts are very much alike, as follows:

I have been thinking a bit myself... First I wondered what happened during the boot process in the first place, thought about the partition's "boot" flag and such things. It turns out this is a hangover from DOS/Windows and is not used at all with lilo/grub/grub2. Then I read about where the boot code is actually located, and found it could in fact be several places. First, the "MBR" may have a number of sectors free BEFORE the first actual partition, and use this space for the boot code. Second, every partition is "free" to host its own boot code, but may be tampered by e.g. aggressive fsck reordering. This last item I have decided to ignore, and rely on my partitioning to leave some room prior to /dev/sda1. So my plan is as follows, and I hope it will work:

(1) Install Mint: repartition the disk completely, leaving some MiBs free before /dev/sda1; install boot to /dev/sda
(2) Install Ubuntu: make a partition for it, and install its boot loader there (/dev/sda2)
(3) Install SuSE: repetition (/dev/sda3)

This should leave me with a system that uses Mints boot code first, letting me choose OS from there, and if I choose one of the other distros, their boot code will believe the OS is alone, therefore presenting no new menu at all!

Wish me luck :)

- Bernt

Knightron 12-09-2011 06:21 PM

OK great, let us know how it turns out. That's chainloading by the way. Lastly, for the record, i recently tried out opensuse 12.1, but no longer have it on my system. As stated before, i have a grub legacy partition on my system which boots up and then chainloads to each of my distros. When i installed Opensuse 12.1 on my computer, it's grub to it's /, i thought it'd be fine, but it wasn't. The way my grub partition works is, when the computer boots up, the mbr consults the boot partition at /dev/sda(x) so it knows what to boot. When i installed opensuse, and this is the only distro i've had do this, it overwrote where the mbr should consult and told the mbr to consult the opensuse partition instead. It was a simple fix once i realized what the hell had gone on, but i found it intrusive, and you may encounter similar issues once you install opensuse.

Bernt.Ribbum 12-09-2011 06:32 PM

Quote:

Originally Posted by Knightron (Post 4546264)
OK great, let us know how it turns out. That's chainloading by the way. Lastly, for the record, i recently tried out opensuse 12.1, but no longer have it on my system. As stated before, i have a grub legacy partition on my system which boots up and then chainloads to each of my distros. When i installed Opensuse 12.1 on my computer, it's grub to it's /, i thought it'd be fine, but it wasn't. The way my grub partition works is, when the computer boots up, the mbr consults the boot partition at /dev/sda(x) so it knows what to boot. When i installed opensuse, and this is the only distro i've had do this, it overwrote where the mbr should consult and told the mbr to consult the opensuse partition instead. It was a simple fix once i realized what the hell had gone on, but i found it intrusive, and you may encounter similar issues once you install opensuse.

Thank you for the warning! I installed OpenSuSE 11 on my current system and had no particular problems with it, therefore I planned as stated above. I'll let you know after a good night's sleep :)

- Bernt

Bernt.Ribbum 12-10-2011 11:26 AM

I promised to post an update - here it is: I have decided to leave my system alone! After all, it boots perfectly well now, and I have my three Linux distros working very well indeed. If I decide to go for something more, I will probably be back, but for now I'm happy with what I have learned so far. Luckily I don't use any proprietary software that will destroy my system for no reason. So: happy now ;)

- Bernt

chip66 12-10-2011 01:05 PM

Hey,
Here's a suggestion for the grub people: since grub goes out to other partitions and looks for kernels to boot, how about looking for other grub installations and offering to unify them?


All times are GMT -5. The time now is 06:48 PM.