As promised in our earlier post, in this post we are going to review boot process in Linux Operating System. How Operating system passes through different stage of booting states. This article is written for those readers who has just steps in Linux world. Understanding how Linux boots up is very important in terms of effectively troubleshooting in case of system failure. When a system switched on and after few moment we get a login prompt. Have we try to find out what all stage of booting sequence has crossed and what happened behind the scene during system boots up.
Power on
- BIOS (Basic Input Output System) is a software program comes pre-built in a motherboard chipset.
- BIOS loads and scans for devices such as Hard Disk, CD-ROM, RAM, etc.
- BIOS searches for MBR (Master Boot Record: 1st sector) of the primary hard drive, it scans for 1st stage loader (In our case boot loader is (GRUB LILO) and hands over the responsibility to MBR.
- Boot PROM/FLASH/BIOS is proficient of loading the MBR into RAM and executing it.
MBR (Master Boot Record)
- 512 bytes of space –> MBR
- MBR contains the information of loader of most operating system e.g UNIX, Linux and WINDOWS
- MBR holds the small binary information of 1st stage of loader
- MBR consist physical sector of the first disk drive (i.e 512 bytes) and it’s not part of any partition.
- Placed on the prime disk drive, in the prime sector of the first cylinder of track is 0 and head is 0 (this whole path is generally booked for boot programs)
- MBR involve a mini executable programs and a table specify the primary partitions.
- MBR also document which primary partition is ACTIVE.
- The BIOS surrender rights to the first stage boot loader, which then scans partition table and finds second stage boot loader on the partition configured as bootable.
Boot Loader
- The boot loader termed from 1st stage loader and loads itself into RAM. All this go on in milliseconds.
- The default stage 2 boot loader is a GRUB (Grand Unified Boot Loader) or LILO (Linux Loader)
- Once GRUB is loaded into RAM, then it’s search for the location of Kernel.
- GRUB will scrutinize the map file to find the kernel image, that is located under (/boot) and load it.
- GRUB loads the kernel (vmlinuz-version) from /boot partition
Trivia 1
GRUB organize RAMDISK for initrd —> (RAMDISK is reserved space from RAM). In addition, it drives initrd into RAM to ready the kernel for loading itself into memory and depended modules so that it can leave the system to “init” process
In, Linux most of the drivers are pre-built as modules, these would be initial ram drive (initrd.img) where it can keep all the information of additional modules. So, when the kernel boots, it creates ramdrive, loads the initrd.img and its depended modules.
GRUB reads /boot/grub/grub.conf & shows us a clean interface for selecting Operating System.
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
► Read more: http://adf.ly/1n7SX8
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
No comments:
Post a Comment