Friday, August 3, 2007

Working With The GRUB Menu

This tutorial describes how to edit the GRUB menu. It will also show how to add operating systems and how to add splash screens.

What everything means

To start off I will go over why you would use GRUB and what it all means.

The reason anyone would use the GRUB menu is to dual-boot two different operating systems. All it is is a simple DOS menu that you select which operating system you want to load during boot-up.

To open it type -

gksudo gedit /boot/grub/menu.lst

This will open up the menu.lst (the file in which you edit the GRUB Menu) in a simple text editor while giving you the ability to make changes and save them.

You will see a bunch of lines at first that all begin with "#". That tells the file to skip over these lines when reading the file. Scroll down into you stop seeing them.

Title - This is what is shown when the menu loads at boot up. Editing this will only change what is written on the screen.

Root - You likely have something along these lines "(hd0,1)". "hd0" refers to the your hard drive while 1 points to the partition. Note that for GRUB, partitions start at 0 and not 1. for example 0=Partition 1, 1=Partition 2 and so on.

Kernel -Pretty self-explanatory. This just is to ask what kernel version you would like to boot with.

Initrd - This is simple a temporary file system used by the kernel during a boot till the real file system can be mounted.

That is the basics of what all those lines mean.

Adding an OS

Adding an operating system to your grub menu is by no means difficult. Just fill in a few lines and you are done!

1. Open up Terminal (Applications>Accessories>Terminal) and run -

gksudo gedit /boot/grub/menu.lst

Once menu.lst opens up, scroll down to the button of the page. For this example I will be adding "Windows XP".

First add the title, which should look like what is shown bellow -

title        Microsoft Windows XP

Now to add the root for the OS. For me it is on the 1st disk and the third partition so I will put the following -

root        (hd0,2)

To finish it off add the following lines -

makeactive
chainloader +1

Definitions -

The final product should look something like this (with your options of course) -

title        Microsoft Windows XP
root (hd0,2)
makeactive
chainloader +1

Save and reboot to make sure it worked correctly

Installing a Splash Screen

As you have probably noticed, the default look of GRUB is nothing too exciting. But fear not, you can install splash screens to spice it up a bit!

To start off find a image that pleases you (9 beautiful screens). Make sure it meets the requirements though -

  • .xpm file
  • 640x480
  • 14 colors only

1. Download an image and add it to a directory.

2. Open up your GRUB file again -

gksudo gedit /boot/grub/menu.lst

3. To keep it organized, add the following line under "Pretty colours" -

splashimage=(hd0,1)your/directory/splashimage.xpm

Remember to change the above line accordingly and reboot to test.

No comments: