We’ve talked previously about Linux boot loaders, but in this article we’ll take a closer look at GRUB’s configuration file. On CentOS distributions, boot loader location can be found under /boot/grub. Within this directory you will see several files, but the one we will focus on is grub.conf
Execute cat grub.conf to take a closer look at the config file:
default=0 – specifies the default title to be loaded if the timeout period has expired
timeout=5 – GRUB will wait the specified interval (in seconds) before it will load the default title
splashimage=(hd0,0)/grub/splash.xpm.gz – the splash screen image that will be displayed when GRUB boots. hd0,0 – specifies the first partition on the first disk (in my case /dev/sda).
hiddenmenu – GRUB menu will not be displayed once the timeout period has expired and instead, the default OS will be loaded
title CentOS 6 (2.6.32-504.el6.x86_64) – the name of a specific OS within the GRUB menu
kernel /vmlinuz-2.6.32-504.el6.x86_64 ro root=/dev/mapper/vg_centos01-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_centos01/lv_root SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rd_LVM_LV=vg_centos01/lv_swap rhgb quiet – specifies the kernel image location, the root partition and other kernel options such as language or keyboard.
initrd /initramfs-2.6.32-504.el6.x86_64.img – specifies the RAM file that will be used in the initial boot process.
If you want to configure a dual boot with Linux and Windows, you will have to add the following lines within GRUB:
title Windows – name of the new OS
rootnoverify (hd1,0) – specifies the root partition for the OS but does not mount it
makeactive – flags the specified partition as active
chainloader +1 – loads that file as a chain-loader. This means that GRUB will load the file that will load the boot loader for Windows.
boot – boots the chain-loader