LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Grub and dual-booting two Linux distros (https://www.linuxquestions.org/questions/linux-general-1/grub-and-dual-booting-two-linux-distros-313489/)

RonRussell 04-15-2005 06:06 AM

Grub and dual-booting two Linux distros
 
I am a very happy user of SimplyMepis 2004, and when I received news that Mepis had released an updated version with a new KDE, Firefox browser, and other enhancements, I was interested. However, I did not want to overwrite my existing setup, as I didn't want to lose my large collection of music files saved on the hard drive to be played with XMMS.
I ordered the live CD for the new SimplyMepis 3.3, and it arrived in just a few days. The 'old' version, 2004, was already installed on my master hard drive, hda. I had a second hard drive with (ahem) another operating system installed as the slave, hdb. So I installed the 'new' SimplyMepis 3.3 to hdb in order to not distrub my existing installation on hda. When I was asked if I wished to install grub, I thought 'why not, if it messes something up, I can fix it', and clicked 'Yes'
Upon rebooting, I was greeted with a new splash screen, and options for two Linux kernels, both on hdb, but neither of my existing kernels on hda.
Investigating into this, I found that grub looks at a file located at /boot/grub/menu.lst for list of boot options to display. Since I had two distros, I had similar, but not identical files on hda and on hdb. The significant thing is that grub will look for the file on the drive where the distro it came with is installed. So grub which came with SimplyMepis 2004 will look for /boot/grub/menu.lst on hda, because that was where I installed S.M.2004. Grub which came with SimplyMepis 3.3 will look for the /boot/grub/menu.lst on hdb, because that was where I installed S.M. 3.3.
So, how to boot BOTH distros? First, decide which one you want to be your 'default' and use grub for that distro. I wanted my existing S.M. 2004 to be default while I experimented with S.M. 3.3, so I tossed in the LiveCD for S.M. 2004 and reinstalled grub.
Now I'm greeted with my original SimplyMepis splash screen, and the kernel options which exist on hda, my master drive. So all is right with that. To enable the kernels on hdb to boot, the file /boot/grub/menu.list on hda needed to be edited. I did this very simply, by logging on as root and copying two paragraphs of text from /boot/grub/menu.lst on the slave drive, hdb. Then I pasted those two paragraphs directly into /boot/grub/menu.lst on the master drive, hda. Now the default /boot/grub/menu.lst looks like this:

default saved
timeout 15
color cyan/blue white/blue
foreground ffffff
background 2f5178
splashimage /boot/grub/mepis.xpm.gz

title MEPIS at hda1, kernel 2.6.7
kernel (hd0,0)/boot/vmlinuz-2.6.7 root=/dev/hda1 nomce psmouse.proto=imps quiet splash=verbose vga=791
initrd (hd0,0)/boot/initrd.mepis
savedefault

title MEPIS at hda1, kernel 2.4.26
kernel (hd0,0)/boot/vmlinuz-2.4.26 root=/dev/hda1 nomce quiet splash=verbose vga=791 hdc=ide-scsi hdd=ide-scsi
initrd (hd0,0)/boot/initrd.mepis
savedefault

title MEPIS at hdb1, kernel 2.6.10
kernel (hd1,0)/boot/vmlinuz-2.6.10 root=/dev/hdb1 nomce psmouse.proto=imps quiet splash=verbose vga=791
initrd (hd1,0)/boot/initrd.splash

title MEPIS at hdb1, kernel 2.4.29
kernel (hd1,0)/boot/vmlinuz-2.4.29 root=/dev/hdb1 nomce quiet splash=verbose vga=791 hdc=ide-scsi hdd=ide-scsi
initrd (hd1,0)/boot/initrd.splash

title MEMTEST
kernel /boot/memtest86.bin

The only part which has been added are the paragraphs which begin with the word 'title', and refer to kernels at hdb1. These describe the kernels options which will be added to the splash screen, and their locations.

Now, when starting the computer, I am greeted by the original SimplyMepis 2004 splash screen, but with additional kernels options. I can boot my customized S.M.2004, with all my email addresses, bookmarks, and music files intact, or I can boot the new S.M. 3.3 and experiment with that, making any changes desired, secure in the knowledge that my S.M. 2004 installation will not be affected.

bigrigdriver 04-15-2005 07:07 PM

Or, simply stated: if you already have an installed version of grub (written to the MBR) to boot a Linux distro, when you install a SECOND Linux distro, write grub to the Linux partition, instead of to the MBR. You will still have to edit the /boot/grub/menu.lst of the first (Master) Linux distro. But that's as easy as booting into the FIRST distro, mounting the second partition, and copy/paste the menu.lst lines for the second Linux installation to the menu.lst of the first.

Been there; done that. Learned the hard way.

gorzuate 04-15-2005 08:04 PM

Well that was useful information. Thanks!


All times are GMT -5. The time now is 07:22 PM.