Académique Documents
Professionnel Documents
Culture Documents
CHAPTER 8
Booting process
During the system start up there are 6 major states are there in Linux.
1. BIOS
2. MBR
3. GRUB
4. KERNEL
5. INIT
6. RUN LEVEL
BIOS
BIOS is basic Input and Output system
Performs the basic hardware that is required for system booting
Searches, loads and executes the boot loader
Once bootloader is loaded the BIOS gives control to the bootloader.
In short BIOS locates and loades the bootloader MBR bootloader
MBR
MBR stands for Master Boot Record
It is located in the 1st sector of the boot disk or root disk (/dev/had, /dev/sda)
MBR is less than 512 bytes in size. This has 3 components 1. Primary boot
loader (1 – 446 bytes) 2. Partition table information (Next 64 bytes) 3. MBR
validation check (in last 2 bytes).
MBR contains information about GRuB (LILO in older versions)
In short MBR loads GRuB
GRUB
GRUB stands for GRand Unified Bootloader.
You can choose kernel image to be executed if you have multiple images
GRUB displays the flash screen, waits for few seconds
Chooses the default kernel if alternate kernel image is not chosen
GRUB have the knowledge of the filesystem.
GRUB configuration files are /etc/grub.conf /boot/grub/grub.conf (link)
KERNEL
Mounts the root file system as specified in “root= in grub.conf
Kernel executes /sbin/init program
Initrd stand for initial RAM Disk
Initrd is used by kernel as temporary file system until kernel is booted and
the real root file system is mounted.
Initrd contains necessary drivers which helps to access the hard drive
partitions and other hardware.
Init
Chapter 8 Page 1
Redhat - Booting
Run Levels
0 – halt
1-single user mode
2- Multiuser mode
3 – Full multiuser mode
4- Unused
5- Multiuser mode with desktop
6- Reboot
Shutdown command
root@server910:/etc/init.d : shutdown --help
shutdown: invalid option -- '-'
Usage: shutdown [-akrhHPfnc] [-t secs] time [warning message]
-a: use /etc/shutdown.allow
-k: don't really shutdown, only warn.
-r: reboot after shutdown.
-h: halt after shutdown.
-P: halt action is to turn off power.
-H: halt action is to just halt.
Chapter 8 Page 2
Redhat - Booting
Steps:
1. Insert the CD ROM
2. Boot the system with option Rescue installed system Mode
3. Choose English option menu
4. Choose ‘US’
5. Local CD/DVD
6. Start network NO
7. Choose option CONTINUE
8. Chroot /mnt/sys image
9. OK
10. Shell Start shell
11. Chroot /mnt/sysimage
12. Check the partition on which /boot is using
13. Grub-install /dev/sda2
14. Reboot
Chapter 8 Page 3
Redhat - Booting
Listing modules
The drives in Linux is known as ‘Modules or Kernel Modules’
Modules are assigned by kernel basing on HW
HW can only be communicated and can work efficiently when proper module
is loaded.
All kernel modules will be in /etc/lib/modules directory
# ls –l /etc/lib/module
# find /etc –name “*.ko”
# lsmod
Chapter 8 Page 4
Redhat - Booting
To blacklist a module
# /etc/modprobe.d/blacklist.conf
Chapter 8 Page 5