- GRUB (stage 1)
- GRUB (stage 2)-- /etc/grub.conf
Components in the file grub.conf
- Time out
- Splash image : The wall paper
- Title : Windows, linux, dos, etc
Few parameters in grub.conf
root (0,0) : This means the root is in hard disk 1, partition 1
kernel: The kernel to be used
Rhgb quiet: This will hide the kernel messages
Initrd: will have image of “necessary” drivers while booting.
If another OS (Windows) is also installed the grub.conf file will have another block with
- title Dos
- rootnoverify (hd0,1)
- deviceloader +1
At the booting time, when the menu to choose the OS appears, pressing “c” will bring us the grub prompt (GRUB >).
Here various commands could be executed. Example:
GRUB> root (hd0, “press tab key”
This will show the various partitions
If the / is in (hd0,4), we could type “cat /etc/groups” to see the contents of the “groups” file.
If grub cannot find the kernel to be used do the following:
- GRUB> root(hd0,4)
- kernel /vmlinuz ro root=LABEL=/
- initrd /initrd?.img
- 0 -- Halt
- 1 -- single user mode
- 2 -- no nfs
- 3 -- Text mode with NW
- 4 -- user definable
- 5 -- XII
- 6 -- Reboot
If the system do not bootup following could be tried:
- GRUB> (hd0,0)
- GRUB> kernel /kmlinyz-184.108.40.206.EL ro root=LABEL
- GRUB> initrd /initrd-?..
Init -> inittab -> will call for many other files including rc0 to rc6
The rc0 will have only kill commands. All the links in rc6 will start with ‘K’ by norm
No 1 -- 6 in the inittab runs getty. These are definitions for the virtual terminals.
If we add a line : “20:2345:respawn:/sbin/migetty tty 20” a new terminal will be added. This new terminal will work only after reboot.
Note: /etc/security will have info about the terminals root can log in.
# init -q
# chvt 20 is to switch terminal using CLI.
Change run level at bootup/grub
If we want to switch to a different run level at the bootup itself, the following has to be done at the boot prompt at startup.
- At the startup, at the grub menu press ‘e’
- Select the kernel entry and press “e”
- After rhgb quiet enter 1 after a space and press the ENTER key.
- Now system will reboot in run level 1