Installing a second Linux distro: what to do about Grub?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
If Grub reports no error when you swap the hard disks then you should pay attention to the lines below marked in red
Code:
# Modified by YaST2. Last modification on Sun Mar 23 12:26:54 EDT 2008
default 0
timeout 2
##YaST - generic_mbr
gfxmenu (hd0,0)/boot/message
##YaST - activate
###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 10.3
root (hd0,0)
kernel /boot/vmlinuz-2.6.22.5-31-default root=/dev/sda1 vga=0x317 resume=/dev/sda5 splash=silent showopts
initrd /boot/initrd-2.6.22.5-31-default
###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.0 - External drive
root (hd1,0)
kernel /boot/vmlinuz-2.6.25-26-default root=/dev/disk/by-id/scsi-SATA_ST3500320AS_5QM0PP7M-part1 resume=/dev/sda5 splash=silent showopts vga=0x31a
initrd /boot/initrd-2.6.25-26-default
This line "gfxmenu (hd0,0)/boot/message" instructs Grub to load the graphic menu available in (hd0,0) so If you present a wrong disk Grub will not be able to load the file and stuck there.
Your Suse 10.3 will boot if it is (hd0) and physically connected to the first Sata port of the mobo (in order to get detected first and received the sda designation).
Your Suse 11.0 can be placed physically in any Sata connection point but it must be on the first partition of hard disk identified in your PC as device SATA_ST3500320AS_5QM0PP7M
If you give all the things Grub can find then you will never have a booting problem.
I recommend putting a "#" in front of the gfxmenu statement thereby disabling it and obtain a text menu instead. In a text menu you deal with Grub directly and can overcome any problem by pressing the "c" key to drop into a Grub prompt.
There is no installed operating system in the world that you cannot boot up with a Grub prompt! I have tried for years and couldn't find one.
You can ask Grub to tell you the geometry of disk (hd0) and (hd1) by command
Code:
geometry (hd0)
geometry (hd1)
from which you can see the partitions and able to tell which is which exactly the way Grub sees it.
You can ask Grub to display your menu.lst, say it is in (hd0,0) by command
Code:
root (hd0,0)
cat /boot/grub/menu.lst
You can ask Grub to fire the menu.lst up in (hd0) by command
Code:
root (hd0)
configfile /boot/grub/menu.lst
You can edit the lines while booting with the "e" (for edit).
You can display any menu.lst and follow the commands to boot any system manually in a Grub prompt.
You can ask Grub to reboot or turn off the PC.
You will not be able to find a program that works faster than a Grub prompt.
So why go through a middleman like gfxmenu. Talk to Grub directly and let it solve all your booting problems.
That thread is definatley going in my "Linux you must know" bookmarks.
I have no doubt grub can boot anything and probably MAC OSX as well, which is possible to install on a Intel PC. It only takes some user experience to get the hang of it, like anything else in Linux.
I will remove for ever my gfx menu.
I like the idea of rebooting or shutting down the PC from the grub menu, actually that's something I would often need. I will check around what the commands are and create them in the menu.
For my HDDs setup, what I don't understand is that I specifically used DEVICE ID setup for my (hd1,0) so that grub would point to it by its ID and not by the path like sda or sdb. So when I click on the (hd1,0) menu line grub then tries to start the kernel and initrd from the SATA_ST3500320AS_5QM0PP7M disk. It does so whether I run 2 HDDs or only one. But when i run one, it works and when run both, it doesn't, with error 2.
Grub is in the 1st partition of (hd1,0). Actually it is located in (hd1,0).
HA! Interesting... geometry (hd0) gives results, but geometry (hd1) gives Error 21: Selected disk does not exist. Maybe that explains why it doesn't boot when I have both HDDs running. fdisk -l gives all the info on (hd1), though...
Here's another way to use multiple GRUB's. For example, you have one Linux on sda1, second on sda2, third is on sda3. Common swap on sda4. All three Linuxes have GRUB installed to their respective partitions. To chainload them you can use a simpler bootloader, like GAG. GAG does not have any files on any partitions (unlike GRUB) and as such is totally independent.
As I understand it, but please correct me if I'm wrong, if you want to install GAG, you need to have Grub on the root partition of every OS you install, not on the MBR. I looked into installing GAG, it has excellent reviews, but I decided that moving Grub was a bit risky so I didn't attempt it.
Thanks for the links Frank64. That's exactly the sort of thing I was looking for.
I haven't tried GAG, but I tried different things in GRUB and I was amazed about that chainload function.
First I got rid of the stupid gfxmenu. Then I added myself REBOOT, HALT, CHAINLOAD+1 and FIRE MENU.LST FROM HD1.
I did not try reboot and halt yet, but I am sure they work, took the commands from one of the sites I posted.
I tried firing up menu.lst of root(1,0) but that ended in error 17 I think, cannot mount partition or filesystem. Ok, next, chainload. It then loaded the grub menu of (hd1) and when I selected the usual choice, IT BOOTED FROM MY SECOND HD!!!!! HURRAY!!
Well actually I needed to edit from command-line and change root(0,0) to root(1,0) from the menu.lst of the Hd1 and all was fine. So I will use that option, chainloading distros and HDs this way.
The Grub prompt is the most lethal weapon in booting. The commands you use if booting automatically are exactly those in menu.lst. Thus menu.lst is a script file.
Never tried GAG myself but when I look at it last time it seemed to have a limit in the number of booting choices something like 12. Grub has done at least 10 times of that amount for me.
AFAIK Grub is the only boot loader that allows a user to boot up any system manually, can be installed in any medium (floppy, CD, internal hard disk, external hasrd disk, USB memory device), able to survive on its own (without an operating system attached) and can boot any operating system in a PC.
I don't know if I should start a new thread or not, but my problem relates to this one, and so I'll post here. The trouble is that I can't access my Archlinux partition from Debian. When I try to mount this partition, I get a permissions error. I've tried using chmod 0777 /dev/hda3, and I've also done a chown, but to no avail. Also, I don't see this partition in /media, despite my efforts to get it to mount there. I have altered the fstab file to try and make this all happen, but this doesn't work (I have to say that I'm very much a newbie with fiddling with fstab, so my error may be here.). Here is the result of fdisk -l:
Code:
Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 7047 56604996 83 Linux
/dev/hda2 9447 9729 2273197+ 5 Extended
/dev/hda3 7048 9446 19269967+ 83 Linux
/dev/hda5 9447 9729 2273166 82 Linux swap / Solaris
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.