Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > Your Distro > Redhat / Fedora Linux Help > Changing default O.S. in grub

Forgot Password?
 Redhat / Fedora Linux Help   Help and discussion related to Redhat and Fedora Linux.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 01-15-2006   #1 (permalink)
Just Joined!
 
Join Date: Oct 2005
Posts: 17
Changing default O.S. in grub

Hello all,

I have a dual boot setup using GRUB, currently windows XP is set to boot first. I would like to configure it so that RedHat boots by default. Any help would be greatly appreciated.
REDHATnardo is offline  


Reply With Quote
Old 01-15-2006   #2 (permalink)
Linux Engineer
 
Nerderello's Avatar
 
Join Date: Apr 2003
Location: North East England
Posts: 1,190
grub uses a configuration file called /boot/grub/grub.conf .

In this file you'll find (near the top) a line that read default= followed by a number (probably zero).

What you need to do is edit this file, as the root/super user, and change the default= number to be the number of the title that you want to load by default.

In English, that means that you will either logon as root, or open up a terminal/console window and type 'su -' followed by the root's password, and then type kedit, or gedit, or kate (ie. the name of a text editor).

You'll then open the /boot/grub/grub.conf file and notice that each operating system has an entry that starts with a 'title' line (starting to get the picture?). So, count (starting at zero, not one) the title line of the operating system (WinXP) that you want to be the default.

Example (taken from the tutorial area of this forum) :-

Here is the /boot/grub/grub.conf file :-
Code:
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core 2 (2.6.5-1.358)
        root (hd0,0)
        kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/1 hda=38792,16,63
        initrd /initrd-2.6.5-1.358.img
title Mandrake 10.0
        root (hd0,0)
        kernel /vmlinuz-2.6.3-4mdk ro root=/dev/hda6 hda=38792,16,63
        initrd /initrd-2.6.3-4mdk.img
title Slackware
        root (hd0,4)
        kernel /boot/vmlinuz-ide-2.4.22 ro root=/dev/hda5 hda=38792,16,63
title BeOS
map (hd0) (hd2)
map (hd2) (hd0)
rootnoverify (hd2,4)
chainloader +1
title Windows 98 SE
map (hd0) (hd2)
map (hd2) (hd0)
rootnoverify (hd2,0)
makeactive
chainloader +1
title Fedora Core 1 (2.4.22-1.2188.nptl)
root (hd1,0)
kernel /boot/vmlinuz-2.4.22-1.2188.nptl ro root=/dev/hdc1
initrd /boot/initrd-2.4.22-1.2188.nptl.img
And we can see from this that the default operating system is zero (Fedora Core 2 (2.6.5-1.358 ).

To change it so that Windows boots by default I change the number in default to 4 (it's the fifth title, but we count starting at zero), like so :-

Code:
default=4
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core 2 (2.6.5-1.358)
        root (hd0,0)
        kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/1 hda=38792,16,63
        initrd /initrd-2.6.5-1.358.img
title Mandrake 10.0
        root (hd0,0)
        kernel /vmlinuz-2.6.3-4mdk ro root=/dev/hda6 hda=38792,16,63
        initrd /initrd-2.6.3-4mdk.img
title Slackware
        root (hd0,4)
        kernel /boot/vmlinuz-ide-2.4.22 ro root=/dev/hda5 hda=38792,16,63
title BeOS
map (hd0) (hd2)
map (hd2) (hd0)
rootnoverify (hd2,4)
chainloader +1
title Windows 98 SE
map (hd0) (hd2)
map (hd2) (hd0)
rootnoverify (hd2,0)
makeactive
chainloader +1
title Fedora Core 1 (2.4.22-1.2188.nptl)
root (hd1,0)
kernel /boot/vmlinuz-2.4.22-1.2188.nptl ro root=/dev/hdc1
initrd /boot/initrd-2.4.22-1.2188.nptl.img
And there you have it.

have fun

Nerderello
__________________

Use Suse 10.1 and occasionally play with Kubuntu
Also have Windows 98SE and BeOS
Nerderello is offline   Reply With Quote
Old 01-17-2006   #3 (permalink)
Just Joined!
 
Join Date: Oct 2005
Posts: 17
Thanks a bunch.

I should have looked a little more before I made a thread on it. I didn't realize that it was in the tutorials.
REDHATnardo is offline   Reply With Quote
Old 01-17-2006   #4 (permalink)
Linux Engineer
 
Nerderello's Avatar
 
Join Date: Apr 2003
Location: North East England
Posts: 1,190
no problems.

There's some good stuff in the tutorials. Well worth a browse.

Nerderello
__________________

Use Suse 10.1 and occasionally play with Kubuntu
Also have Windows 98SE and BeOS
Nerderello is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 02:44 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2