Sign In

    Enjoy FOSSwire's content? Have it delivered! Subscribe

    Reorder your Boot Menu Manually

    Last week, I covered how to use KGRUBEditor to re-order the boot menu you see at startup, so that dual boot users could move Windows to the top of the list if they would like.

    It is also relatively simple, however, to manually reorder this menu by editing the configuration file of GRUB (that's the boot loader).

    This tutorial will focus on Debian/Ubuntu, however these instructions should be able to be followed on any distribution (just ignore things about the automagic kernel list).

    First of all, a word of warning. Editing configuration files can be a potentially risky business. Make sure you know what you're doing. You should also make a copy of the file /boot/grub/menu.lst and store it somewhere safe (you can restore it with a Live CD later if the worst does happen). If anything does go wrong, see the end of this post.

    Right, let's get started. First of all, we need to open up the configuration file in an editor.

    Assuming you're running GNOME, press Alt-F2 to bring up the Run Application window. Type gksu gedit /boot/grub/menu.lst and click Run. Enter your password when prompted.

    Run Application window

    This will open up a text editor, with the GRUB configuration file ready to edit. So let's assume once again that you want Windows to be the default entry.

    Scroll towards the bottom of the file, you should see a section similar to this:

    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/sda1
    title Microsoft Windows XP Home Edition
    root (hd0,0)
    savedefault
    makeactive
    chainloader +1

    Select this whole section and choose Edit > Cut.

    Scroll back up to find a line like this:

    #
    # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

    Just after that line, but before BEGIN AUTOMAGIC KERNEL LIST, use Edit > Paste to put the Windows entry above all the Ubuntu entries.

    Save the file and quit the editor. Assuming you did the process correctly, when you reboot, Windows should be at the top of the list and the default boot option. To start Linux, simply press down once and then Enter!

    If you did run into problems, you can restore the functionality of Windows by booting the computer with the Windows XP CD in, choosing to go into the Recovery Console and typing fixmbr at the prompt. Linux can then be fixed by re-running the GRUB install from a Live CD.


    Reorder your Boot Menu with KGRUBEditor

    Maybe you've just installed a dual boot system. It's all going well and good, but when you start the computer, Windows appears at the bottom of the boot menu.

    You might still want to use Windows as your primary operating system, and so pressing down a few times and Enter each boot time could get frustrating. You'd ideally like Windows at the top of the boot menu, and Linux second.

    In this quick tutorial, I'm going to show you how to use KGRUBEditor, a program for editing your boot menu settings, to re-order the menu so that Windows is first, and the default choice.

    (If you'd rather quickly edit the configuration file by hand, without installing new software, take a look at this alternative tutorial).

    First of all, we need to install KGRUBEditor. You'll probably find it in your package manager if you search for kgrubeditor (help on installing packages).

    Once it's installed, launch it, from the System category.

    Kdesudo dialogue

    You will be asked to give your (or root's) password to continue. A word of warning - through KGRUBEditor, you are editing important settings that tell your computer how to start up properly. Avoid changing settings you don't fully understand!

    Once you're in, you'll see something a bit like this (your entries might look slightly different).

    KGRUBEditor Interface

    Each row in the top pane should correspond to one of the choices you see when the computer starts up.

    Click on the Windows row, so that it is selected. Now go to the menu and choose Actions > Move to Top.

    KGRUBEditor Actions menu

    Once the Windows entry is at the top, you need to also set it as the 'default' entry, so it is the first choice to be selected (otherwise it will be at the top, but not selected).

    Right-click the entry for Windows, and choose Set as default.

    And that should be it. You can now close KGRUBEditor and reboot to find Windows your default choice. To boot Linux, you can just press down once to the first Linux entry and press Enter.


    Colour your GRUB boot menu

    That boring white on black GRUB boot menu you get when you switch on your computer is a bit, well, boring, isn't it?

    Thankfully, there's an easy way to change it if you go into your GRUB configuration file. A word of warning, though, editing the GRUB configuration file without knowing what you're doing can result in bad things happening and can cause you to not be able to boot your system. Tread with caution.

    The configuration file will be located at either /boot/grub/menu.lst or /etc/grub.conf. Open it up, as root, in your favourite text editor.

    The line we need to add is the color command. It works like this:

    color normal [highlight]

    The normal colour, is quite obviously, the colour that will be used normally, and the highlight colour will be the colour when that row is selected to show that it is selected.

    For both normal and highlight, though, you can separate the foreground and background colours with a /.

    An example of this is if we wanted the following - the normal colour is cyan on blue, and the highlight is white on blue. The code we'd need is this:

    color cyan/blue white/blue

    According to the relevant GRUB manual page, the available colours you can use are:

    • black

    • blue

    • green

    • cyan

    • red

    • magenta

    • brown

    • light-gray


      These below can be specified only for the foreground.

    • dark-gray

    • light-blue

    • light-green

    • light-cyan

    • light-red

    • light-magenta

    • yellow

    • white

    Once you've got the color command you want, you need to put it somewhere in your GRUB configuration file. Your default colour scheme should be put somewhere near the top of the file and this will be used for all the entries in your boot menu unless you specify otherwise.

    To have custom colours for an individual entry, just place the relevant color command under its title. For example, if I want my Fedora system to have a red and grey theme, I would have this:

    title Fedora release 8 (Werewolf) (on /dev/sdb1)
    color light-gray/red red/light-gray
    root (hd1,0)
    kernel /boot/vmlinuz-2.6.23.1-42.fc8 ro root=/dev/sdb1
    initrd /boot/initrd-2.6.23-1-42.fc8.img
    savedefault
    boot

    And that's about it. Have fun prettifying your boot sequence!


    1. 1
    2. 2