LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How does GRUB work with multiple linux distros ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-does-grub-work-with-multiple-linux-distros-492213/)

glenn69 10-13-2006 06:15 PM

How does GRUB work with multiple linux distros ?
 
I like to try as many Linux distros as possible. My method is to create many partitions on my hard drive, then install a distro allowing it to put GRUB on MBR. Then for my next distro I do tyhe same, and so on.

The result is that the last distro that I have installed (Ubuntu) placed its version of GRUB on MBR.

Now for the question : How do I modify GRUB from another distro on another partition? I noticed when using LILO, that lilo had to be run after any changes were made to the conf file, subsequently it makes the changes to MBR. GRUB does not have to be run, so how do changes in the conf file make their way to the MBR?

Andrew Benton 10-13-2006 06:23 PM

When GRUB boots, the small application installed on the MBR reads the menu.lst file and then offers you the menu of options. If you want to add other distros, mount the partition the /boot/grub/menu.lst file is on, edit it with a text editor and add the distros you want.

musicman_ace 10-13-2006 06:32 PM

There should be an example file /boot/grub/grub.conf.sample which shows multiple examples for different operating systems.

syg00 10-13-2006 06:45 PM

You are better off getting a working distro and keeping that in the MBR. Subsequent distros should install the loader to the bootsector (or not at all).
Saikee used to have a truckload of links in his sig (I don't see sigs anymore, so this may be wrong now). Have a look for a doco he did - not the only way, but will give you some ideas.

Electro 10-13-2006 06:49 PM

You can use the same /boot partition for every Linux distribution. Some distributions requires more than 100 MB of space for /boot which is very ridiculous. With just 16 MB you can have several Linux distribution stored.

Just add more information to what Andrew Benton have said. GRUB is userspace. This means you edit a file and grub will default to a specific file directly like menu.lst. Also you can define storage devices to desire names instead using the default hd0 for hda or the first drive. Grub is able to access FAT16, FAT32, NTFS, XFS, EXT2, EXT3, ReiserFS, JFS directly with out being dependent with the OS. I prefer EXT3 to store Grub's files. With its latest release, it can boot to a CD/DVD disc.

syg00 10-13-2006 06:58 PM

Quote:

Originally Posted by Electro
With just 16 MB you can have several Linux distribution stored.
...
I prefer EXT3 to store Grub's files.

How does that work ???
Hopefully you meant ext2 - journal is pointless on /boot. But a gentoo user would already know that ... :p

Electro 10-13-2006 11:45 PM

syg00, Journaling is not pointless on /boot. If are editing a config file or forgot to unmount /boot and the power goes out, journal filesystems saves a lot of time. I prefer EXT3 for /boot for added safety. If you like to live dangerously, use EXT2 for /boot. Many distributions have /boot unmounted, if you forgot to mount it before running a backup, you have to depend on the journal when a screw comes loose.

syg00 10-14-2006 12:26 AM

We can agree to disagree - the amount of update to /boot is meaningless. And I would do more than most.
However, I did just try putting a journal on a small partition, and it used significantly less space than I was expecting.
So ...., go for it people ;)

saikee 10-14-2006 05:03 AM

I am not going to repeat myself but Post #9 of this thread documents the easy way.

Electro 10-14-2006 09:24 PM

It maybe the easy way, but it is the hardest way to control how it boots up. Many distributions like Fedora for an example uses special kernel options are require that the chainloader will not know about. I myself uses initrd that contains xfs and hpt366 modules that needs to be loaded. The chainloader will not work.

I suggest making a boot partition and a swap partition then make seperate root partitions. When it comes time to use SATA or SCSI hard drives, you will be able to boot up.

eerok 10-15-2006 12:45 AM

I've used a common /boot (and swap, and for that matter, a /home/data partition) shared between several distros for a couple years now, and it works fine with grub. I just have to remember to clean out old kernels when I install new distros.

I suppose that some day my grub config syntax/format might become obsolete, though it's also possible this box will die first :)

saikee 10-15-2006 04:12 AM

The method I suggested is booting 100+ systems.

It is a common method that works for evry OS I could find in Dos, Windows (includinh Vista), BSD, Solaris and Linux. From over the 100 Linux installed I have not met one that refuses to boot.

Please note in every system the boot loader created by the installer is untouched and preserved in its original form. I keep every system in a single partition.

I just let the boot loader residing in the MBR to boot the other boot loaders. It is one of the two common booting methods and every boot loader in existence uses this method.

Most users do not know a Linux can be boot same as a Windows by another Linux.

As every system has its own boot loader preserved so the user can elect any of them to come out to take control of the MBR, be it a Grub, Lilo or Windows NTLDR. However Windows NTLDR can only boot 10 systems. Lilo maximum is 27. Sky is the limit for Grub.

There is no easier way to multi boot than "chainloading".


All times are GMT -5. The time now is 11:51 AM.