Showing posts with label GRUB. Show all posts
Showing posts with label GRUB. Show all posts

Reduce Boot Menu Delay In Ubuntu

If you dual boot between Ubuntu and Vista/XP you would must have noticed (and became frustrated) by the 10 second delay at the boot time where you can make your selection between Ubuntu or Windows.
Normally you only use one preferred OS and the other OS is rarely used. So you may want to reduce this selection period.
To do this fire up your terminal and type in the following
gksu gedit /boot/grub/menu.lst
Now enter your password.
Now look for the following lines:
## timeout sec
# Set a timeout, in sec seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout    X

Where the X is some number, mostly 10 sec
Change it to something like 2 or 3 (I use 3). 
Save the file and close it. 
[Image]
Now if you ever want to boot into Vista or XP simply hit any key (up, down etc) wile the count down timer runs, to stop the count down timer then choose your OS.
Let us calculate how much time do you save by using this hack:
Suppose you start your PC 3 times in a day. You have changed the timeout to 2 sec, thereby saving 8 sec per boot. So in one day you save approximately 30 sec so at the end of the month you save around 15 min. However the real benefit of using this hack is the amount of frustration the boot menu gives is reduced.

Protecting GRUB Boot loader for CentOS

Much of the material is taken from "How Do I Secure Grub Boot Loader?" taken from http://www.cyberciti.biz/ and the book "Foundation of CentOS Linux" from aspress

Without the GRUB Password, anyone can edit the kernel parameters and boot into single-user mode and  enable them to log as root.

Step 1:
Use grub-md5-crypt command encrypt password in MD5 format:
# grub-md5-crypt

Password:
Retype password:
$1$gBrNd/$QccThGN4QFPdOiOtaTl.c0



Step 2: Edit GRUB configuration file
# vi /boot/grub/menu.lst

Insert this line into /boot/grub/menu.lst
password --md5 $1$gBrNd/$QccThGN4QFPdOiOtaTl.c0

Something like this....
# grub.conf generated by anaconda
#........
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
password --md5 $1$H7tNd/$GEYVMUDHmIkhb4xwNwywR.
title CentOS (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-164.el5.img

It's done. Horray

Boot Time Parameters for Linux Kernel on CentOS 5

In CentOS, the default boot lader is GRUB (Grand Unified Boot loader). GRUB allows users to choose which operating system you would like to boost. In addition, GRUB can be used to inform or pass parameters to the kernel

How to modify GRUB

Step 1:
When GRUB start, press any keys and it will show you a boot menu.

Step 2:
In the menu, you can select the kernel to boot and press "e"

Step 3: You will see something like this on the screen
grub append > ro root=LABEL=/ rhgb quiet

Step 4a: Put in the necessary parameters. For example, if I wish to boot to "single"
grub append > ro root=LABEL=/ single

Step 4b: If I wish to boot into console with network support, use the parameter: init=/sbin/init 3
grub append > ro root=LABEL=/ init=/sbin/init 3

Step 4c: If I wish to specify the memory, use the parameters: mem=MEMORY_SIZE
grub append > ro root=LABEL=/ mem=1024M

Step 4d: If you wish to reboot the kernel after the kernel panic, you can set the parameter panic=SECOND
grub append > ro root=LABEL=/ panic=30

For more parameters, do read the excellent article on
  1. 10 boot time parameters you should know about the Linux kernel
  2. Booting to Single Mode for Centos LINUX