As you know GRUB is the software used by debian operating systems like Ubuntu… for loading and transferring control to the operating system kernel during the initial boot. The new version grub2 has many differences from the previous versions of grub in many aspects of configuring and tweaking. GRUB 2 will be installed by default on new installations of Ubuntu (Karmic).While the main grub boot loader file continues to reside in the /boot/grub folder, it is no longer called as menu.lst in GRUB 2. The main Grub 2 instruction file is now grub.cfg. This file is produced by various scripts. The files responsible for the content of grub.cfg are /etc/default/grub and individual script files located in /etc/grub.d/. The changes made to this scripts are taken into effect when “update-grub” command is issued on the terminal.
Configuring the GRUB 2To make changes to the new GRUB 2 we have to make changes to the script files… So let us discuss about the important configuration files…
grub.cfg (/boot/grub/grub.cfg)
Please don’t make any changes to this file. This is the main configuration file, and it is the sum total of all the scripts that affects the GRUB 2. grub.cfg is the configuration file and it is not the script, you have to change the scripts to modify the grub and not the configuration file. You have to run the “update-grub” command to make the changes into effect (to rebuild the grub.cfg)
grub (/etc/default/grub)
1. Type $ sudo gedit /etc/default/grub to open this file
This file contains information similar to /boot/grub/menu.lst. It contains settings primarily affecting Grub’s menu display. This file can be edited by root to make changes to these settings. These changes will be imported into grub.cfg when “update-grub” is executed.let us discuss about some of the entries in this file
GRUB_TIMEOUT=5
This is the number of seconds before the default entry is automatically booted. Setting a value of -1 will display the menu until the user makes a selection (no timeout).
GRUB_DISABLE_LINUX_RECOVERY=true
Add or uncomment this line to prevent “Recovery” mode kernel options showing in the menu.
2. Save and close the file.
3. Issue the following command in the terminal
/etc/grub.d/ (folder)
1. Type in $cd /etc/grub.d/ to enter into this folder. Issue a ls command to see all the configuration files in this folder
2. We have to modify the 05_debian_theme script file to change the appearance of boot loader. So open that file using the terminal as follows
$ sudo gedit 05_debian_theme (file opened in gedit text editor)
3.Changing colors
look at the 8th & 9th row (first set up color of text, second selected row):
set menu_color_normal=magenta/black
set menu_color_highlight=cyan/blue
(change the colors as per your wish)
4. Setting background image for grub 2
1. Check for the line in the script file as shown in the figure below
2. Here i set my grub background as a picture file, boot.png
What you have to do is just copy a picture file to
/usr/share/images/desktop-base directory. I am just assuming that picture file is now in your desktop.
$sudo cp /home/username/Desktop/filename.png /usr/share/images/desktop-base/
3. Change the 16th line (shown in fig below ) by replacing the word filename with boot
for i in {/boot/grub,/usr/share/images/desktop-base}/filename.{png,tga} ; do
4. That’s enough for the time being. Now save and close the 05_debian_theme script file
5. Run the command $ sudo update-grub to rebuild the grub.cfg file. Then you will see the output as follows…