Showing posts with label boot. Show all posts
Showing posts with label boot. Show all posts

Thursday, February 24, 2011

Windows XP in Grub 2

When I installed Debian 6.0 (Squeeze) on my laptop, I found that Debian Installer had not added Windows XP entry in the GRUB 2. You might also face same issue, then you can add following lines in /boot/grub/grub.cfg



## (1) Windows XP in /dev/sda1
menuentry "Windows XP" {
set root=(hd0,1)
chainloader +1
}




Here are few tips how to set root in the grub.cfg



# DEVICE NAME CONVERSIONS
#
# Linux Grub
# -------------------------
# /dev/fd0 (fd0)
# /dev/sda (hd0)
# /dev/sdb2 (hd1,2)
# /dev/sda3 (hd0,3)
#


Tuesday, December 15, 2009

How to change boot order in GRUB2?

With Ubuntu 9.10 (Karmic Koala), GRUB2 is the default boot loader.
How to change boot order in GRUB2?

1.
$ cat /etc/grub/grub.cfg
see the order of the wanted kernel. Starts from 0.

2.
$ vi /etc/default/grub
change GRUB_DEFAULT=0 value to wanted kernel

3. run
$ update-grub
to update

4. reboot and check with
$ uname -r
to see if correct kernel selected.

Tuesday, May 26, 2009

Securing Your Root Using GRUB

Generally, we forget to provide password security for GRUB boot loader.

If we do not provide password, any one can get access to root login without giving

root password, just by editing “kernel” parameters to “single” or “1″.

Therefore, you can prevent this editing by providing password.

$ grub-md5-crypt
Password:
Retype password:
$1$BRvj2/$A0Xj.CeywUG/iL6j/15HC.

(you can provide any password, you want. But please remember this by heart)
and paste this output in /boot/grub/menu.lst below timeout
or default as


$vi /boot/grub/menu.lst
...
timeout 10
...
password --md5 $1$BRvj2/$A0Xj.CeywUG/iL6j/15HC
...

Now, reboot and try to modify the kernel parameters. You will not be
able to until you press p and provide the password.

Tuesday, June 24, 2008

Reducing Booting Time in Linux

You can reduce the booting time in Linux, by disabling the
services, which are not being used by you.

There is a directory for each run-level in /etc. Those
are named as /etc/rc.< run-level > , where
run-level = 0~6

On most Linux distros, default run-level is 5, in Debian default
run-level is 2.

1. Go to your run-level directory /etc/rc.n

# cd /etc/rc.5

2. If you want to disable, Apache Web-Server (apache), just
you have to rename, the corresponding file my replacing 'S'
(start) by 'K' (kill).

# mv S91apache K91apache


Likewise, you can disable all the undesired services.
This procedure will make your linux not only fast,
but also secure.

Tuesday, June 10, 2008

Booting in Single User Mode in Linux

At the boot time, you usually see GRUB (GRand Unified Boot) Loader.

You select any one option of available OSs from the menu.

For example, if you have Windows and Linux.
You will get 2(or more) options to boot.

In order to boot into single user mode, you select desired
linux and press 'e' in grub menu, you will see new window
with something given below

root (hd0,0)
kernel /boot/vmlinuz-2.6.22.6 root=/dev/sda1 ro resume=/dev/sda3
initrd /boot/initrd.img-2.6.22.6
savedefault

Now, you append '1' or 'single' in the second line (kernel) as kernel
parameter. For example

kernel /boot/vmlinuz-2.6.22.6 root=/dev/sda1 ro resume=/dev/sda3 1

or

kernel /boot/vmlinuz-2.6.22.6 root=/dev/sda1 ro resume=/dev/sda3 single

Now, press 'b', to boot into single user mode. :)