Google
 

Saturday, October 20, 2007

Changing Boot options in GRUB

GRUB (GRand Unified Boot loader) is Multiboot Boot Loader. Briefly, boot loader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the operating system kernel software.

GRUB is the bootloader on my system where it has WinXP and Fedora 7.
First I installed WinXP and then Fedora 7(F7). As I chose default options in installing F7, the default boot option was set to F7. Now this post gives the way to change the boot options in GRUB, so that the default is to WinXP:

First boot to F7 and then open a terminal and login into root using su -, then
cd /boot/grub
cat menu.lst --This displays the GRUB.conf as menu.lst is the link directed to grub.conf
cat grub.conf -- If menu.lst is not there, then directly use grub.conf

which displays the following

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,6)
# kernel /boot/vmlinuz-version ro root=/dev/sda7
# initrd /boot/initrd-version.img
#boot=/dev/sda
default=0
timeout=5

splashimage=(hd0,6)/boot/grub/splash.xpm.gz ?
hiddenmenu
title Fedora Core (2.6.21-1.3194.fc7)
root (hd0,6)
kernel /boot/vmlinuz-2.6.21-1.3194.fc7 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.21-1.3194.fc7.img
title Other
rootnoverify (hd0,0)
chainloader +1

title 0 is Fedora Core and title 1 is Other. Other corresponds to WinXP.
but the default = 0 specifies title 0 is selected, so to change the default OS to be booted, I need to change this default.

So to boot into WinXP by default, change to default = 1 (where title 1 corresponds to Other means WinXP)

Timeout specifies the time the system waits, in which if we didn't press any key, the default OS will be booted. In mean time if we press any key then we will get the Boot Menu to chose the OS to be loaded.Here Timeout = 5 so there will be 5 seconds time for me to get booted into default OS.

10 comments:

Trisul Kanipakam said...

We can also do this during installation itself. We can either choose FC7 or others as our primary operating system. Take a look at this page from Official FC7 installation guide.
Moreover, Windows' boot.ini file also has this feature.
#boot.ini file
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP Media Center Edition" /noexecute=optin /fastdetect
c:\fc7.bin="Fedora Core 7 GNU/Linux"

We can put either windows or fc7 as our default operating system using "default=whatever you want"

Anonymous said...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the MP3 e MP4, I hope you enjoy. The address is http://mp3-mp4-brasil.blogspot.com. A hug.

Anonymous said...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Projetores, I hope you enjoy. The address is http://projetor-brasil.blogspot.com. A hug.

Anonymous said...

Cool story as for me. I'd like to read a bit more concerning this theme.
BTW check the design I've made myself Companionship in London

Anonymous said...

Your blog keeps getting better and better! Your older articles are not as good as newer ones you have a lot more creativity and originality now keep it up!

Anonymous said...

This post is beyond awesome. I am always wondering what to do and what not to do so I will follow some of these tips.

Anonymous said...

Thanks for the writing this! I’m new at this game so am trying to catch up.

Anonymous said...

I am reading this article second time today, you have to be more careful with content leakers. If I will fount it again I will send you a link

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.