Grub configuration

After installing Kubuntu, I had this ugly menu to select which OS I wanted to boot.

I wanted to modify three things: the default menu entry ; the time before the default menu entry is automatically chosen ; having a nice background image (splashimage).

Default OS and timeout

There is a really good article how to change your default grub menu entry on the Ubuntu wiki. One should refer to it. It describes – despite its title – how to change the default time-out as well.

Background image in boot menu

[Note to self: describe how to make a picture and its format ]

[Note to self: describe where to download pictures, ex: http://www.kde-look.org/content/show.php?content=22817 ]

  1. Open a konsole
  2. The best would be to create a directory for your splashimages. Try the following commands:
    $ cd /boot/grub
    $ sudo mkdir splashimages
  1. Then copy your compressed XPM image to this directory. In the example given it is considered that the image was downloaded or created on your Desktop (path is then $HOME/Desktop)
    $ cd splashimages
    $ sudo cp $HOME/Desktop/<image_name>.xpm.gz .
    $ sudo chown root:root <image_name>.xpm.gz
    $ sudo chmod 0644 <image_name>.xpm.gz
    $ cd ..
  1. Then you need to edit the menu.lst file (a configuration file from Grub). You have to ways to edit it, either in text mode using nano, or in graphical mode using kate. You should choose one of the two:
  2. $ sudo nano  menu.lst

    Or

    $ kdesu kate menu.lst
  1. Depending of how you have partitioned your hard disk, the configuration line for Grub might be slightly different. All depends if you dedicated or not a partition for the /boot directory (which I strongly recommend). See below for further explanation.
    If ‘/boot’ is on a dedicated partition:

    splashimage=(hdx,y)/grub/splashimages/<image_name>.xpm.gz

    Whereas if ‘/boot’ is inside the / (or also called root) partition (this is the default installation of Kubuntu/Ubuntu):

    splashimage=(hdx,y)/boot/grub/splashimages/<image_name>.xpm.gz
  1. The ‘x’ and ‘y’ should be replace by numbers. You can find those number by looking at the line which contains “groot=(hdx,y)” (the line can be commented).
  2. Save your file and exit your editor. You just have to try it now. Simply reboot your computer.

Explanation about the boot partition at start-up (when the Grub prompt is displayed)

At start-up, Grub knows only about partitions but nothing about the mounting point of these partitions.
Thus, if you have /boot on a dedicated partition (let say ‘hd0,2’), Grub sees it as just a disk like the famous (ignominious?) C: of Ms DOS. Thus, if Grub looks inside this partition, it will see a grub directory and the Linux kernels. Therefore, when you want to access something inside the grub directory in partition hd2,0, you need to write it down:

(hd0,2)/grub/your_file.

If you would have no dedicated partition for /boot. This means that this directory resides in the root partition (the / one). Such a set-up corresponds to a default installation of any Ubuntu flavour. Thus, if Grub would be looking under the / partition, it will see a ‘boot’ directory. In this case, to access the file under the Grub directory, you need to write:

(hd0,2)/boot/grub/your_file.