Find the answer to your Linux question:
Results 1 to 4 of 4
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. ...
  1. #1
    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.

  2. #2
    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

  3. #3
    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.

  4. #4
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •