LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GRUB help needed (https://www.linuxquestions.org/questions/linux-newbie-8/grub-help-needed-644601/)

concoran 05-25-2008 01:02 AM

GRUB help needed
 
Hello,
I have XP on first bootable disk and CentOS on 2nd disk. I use GRUB to dualboot them. By default, CentOS is the default OS. I am trying to change GRUB so that XP boots first. However, I am not able to do it.

Here's the section of /etc/grub.conf
Code:

default=0
timeout=3
splashimage=(hd1,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS
        root (hd1,0)
        kernel /boot/vmlinuz-2.6.18-53.1.21.el5 ro root=LABEL=/ rhgb quiet
        initrd /boot/initrd-2.6.18-53.1.21.el5.img
title Windows XP
        rootnoverify (hd0,0)
        chainloader +1

I tried to change 'default' to 1, but that does not seem to change the boot choices. Also, after changing default I did 'grub-install /dev/sda', but to no avail.
Can someone help?

syg00 05-25-2008 01:08 AM

Quote:

Originally Posted by concoran (Post 3163896)
I tried to change 'default' to 1, but that does not seem to change the boot choices.

This should have worked - the text should change and XP should default.
What actually happened ???.

Re-running grub-install isn't necessary.

Biglinuxnewb 05-25-2008 01:37 AM

Grub should by default pick XP as the first choice and default to that after the timeout expires. If by defaulting to windows you mean the windows bootloader then this not what this will do. Grub will always be the bootloader for that device, meaning the grub bootloader is always loaded from your default drive's MBR. If you wish to use the NT bootloader by default instead of grub, then if your windows drive still contains the original MBR (it's not overwritten) then you can change your bios so that that drive is the default drive from which to boot. Keep in mind windows' installer is very stupid about where it installs its MBR (it usually picks the first drive it sees, not the drive you actually install the OS to).

concoran 05-25-2008 02:20 AM

I have used GRUB before to dual boot XP/linuxes. In the past, I could just change 'default' value and it would work just fine. I have also used NT loader to boot any of linuxes before to dualboot.
But this is the first time I am using it in CentOS and I am seeing this problem.
In this installation too, I have dabbled between GRUB and NT loader, but each time I just can't seem to be able to boot windows by default.

Honeysuckle 05-25-2008 02:41 AM

Quote:

Originally Posted by concoran (Post 3163896)
Can someone help?

Probably not.....:D but perhaps giving this map command might be worth a try?
http://www.gnu.org/software/grub/manual/grub.html#map

concoran 05-25-2008 07:22 PM

I am now partially able to resolve the situation. Until now, I HAD to use GRUB to be able to boot into CentOS. Now I have installed GRUB into /dev/sdb, copied the sector to c:\, and can use NT loader to actually boot into Linux.

However, i have observed this weird behaviour. GRUB doesn't seem to care for what is in /etc/grub.conf file. For instance, if I change 'CentOS' line to 'Timbuktoo', I still see CentOS in GRUB. If there is another entry (new kernel), I still don't see it in the GRUB menu. And this happens not only after changing grub.conf, but also after re-installing Grub.

Does anyone have experience of GRUB not respecting /etc/grub.conf file? One of the changes that happened to my machine recently is that I shrank the linux partition. But not sure if it has anything to do with grub.

syg00 05-25-2008 07:49 PM

Ooops - should have noticed that earlier.
You should be updating /boot/grub/menu.lst

concoran 05-26-2008 06:26 PM

My bad. I too failed to realize that I should be modifying menu.lst and not /etc/grub.conf.
Now it's working.
Thank you very much for all the replies.

Just curious: if we have menu.lst, why is /etc/grub.conf needed?


All times are GMT -5. The time now is 02:49 PM.