Linux boot process step by step
This Post we will discused about linux boot process.During the The linux boot process, what happens immediately after the phase called kernel.
The UEFI boot spec provides new capacities and new headaches if you’re not prepared for it. Learn the way the Linux user came into a truce with the brand new furnace. Some firsts you shouldn’t ever forget: first automobile, first pc. Nevertheless, among these first shouldn’t be the way you borked your laptops partitions. Sadly, I’d that experience since I was only a little too casual while installing Kubuntu 12.04 double boot with Windows 7. The main reason I’d issues was that the laptop computer and the original pre-installed Windows 7 system were configured to utilize UEFI, and the new Linux, I added afterwards, wasn’t UEFI aware. Linux boot process step by step described in detail below.
Linux boot process step by step
- Press the power button on your system.
- Have you ever wondered what happens behind the scenes from the time you press the power button until the Linux login prompt appears?
|Linux boot process stages|
- BIOS stands for Basic Input/output System.
- BIOS is the first Program that is run.
- After the BISO run, BISO will trigger one function. That is POST.
- POST stands for “Power On Self Test” It is a diagnostic program built into the computer’s hardware that tests different hardware components before the computer boots up.
- Now BIOS looks for the boot device (system have to boot from which device, like CD/ROM, Floppy and HD). You can press a key (typically F12 of F2, but it depends on your system) during the BIOS startup to change the boot sequence.
- Boot device contains MBR. Once the BIOS found the boot Device.
- Then Pass to Boot loader (MBR).
- MBR total size is 512 bytes.
- It is located at a first sector of the device (physical offset 0), preceding the first partition
- This has three components.
- Primary boot loader information in 446 bytes .
- Partition table information in 64 bytes.
- MBR Error check in 2 bytes.
|MBR Total size|
The MBR includes four main partitions, and among those partitions is set as the bootable partition. Along with a listing of the partitions, the MBR includes a very small bootloader to load the OS. This bootloader will find all the active partition and after that proceed to execute the Volume Boot Record, that will continue the procedure of loading the OS. The MBR has some constraints that have held back progress. Two such constraints are that the number of primary walls is limited to four, and also the size of disc walls is limited to 2TB. These limits weren’t an issue when the MBR initially appeared, but now that it’s possible to buy a 3TB Universal Serial Bus disk for less than EUR 200, these issues became increasingly more visible.
MBR Directly can not load the Kernel unaware of the file system concept and requires a boot loader with file system.
- It contains information about GRUB (or LILO in old systems).
- So, in simple terms MBR loads and executes the GRUB boot loader.
- MBR which starts a boot the system via the bootloader.
- From here GRUB (Grand Unified Boot loader) will start.
GRUB stands for Grand Unified Bootloader and it is the default bootloader for many of the Linux distributions. This is because it is better than many of the previous versions of the bootloaders.
- It functions is to take over from BIOS at boot time
- It will appear one GUI Windows that is splash image that is locate “/boot/grub/splash.xpm.gz”
- If you have multiple kernel images installed on your system, you can choose which one to be executed.
- GRUB displays a splash screen, waits for few seconds, if you don’t enter anything, it loads the default kernel image as specified in the grub configuration file.
- GRUB has the knowledge of the filesystem (the older Linux loader LILO didn’t understand filesystem).
- Grub configuration file is “/boot/grub/grub.conf “.
What is Grub Boot Options.
- You can use E for Edit the command before booting.
- A you can use for modify or append the kernel arguments before booting.
- You can use C for open the GRUB command line.
Sample grub.conf file.
|Grub.conf sample File|
The Linux kernel, developed by contributors worldwide, is a free and open-source, monolithic, modular, Unix-like operating system kernel, and it is highly configurable.
- The Kernel are present inside /boot directory along with an initial RAM disk image and device map.
- Linux kernel which you select to boot from (Loads initrd initial ram disk).
- The initrd is used by the linux kernel as a temporary file system.
- Initrd will mount the virtual root file system temporary.
- Instead of using initrd, some Linux file system will also use initramfs.
- Linuxrc can mount the real root file system.Kernel will trigger (init/systemd process).
- This is first process start after system start PID 1.
- Process will load other system demons depending upon the configuration of different runlevel.
Different between init and systemd.
- Init will not list all the chilled process.
- Systemd will list all the chilled process.
- Init will not calculating automatic dependency.
- Systemd will calculating automatic dependency.
When the Linux system is booting up, you might see various services getting started. For example, it might say “starting sendmail.. OK”. Those are the runlevel programs, executed from the run level directory as defined by your run level.
- Run level 0 – /etc/rc.d/rc0.d/
- Run level 1 – /etc/rc.d/rc1.d/
- Run level 2 – /etc/rc.d/rc2.d/
- Run level 3 – /etc/rc.d/rc3.d/
- Run level 4 – /etc/rc.d/rc4.d/
- Run level 5 – /etc/rc.d/rc5.d/
- Run level 6 – /etc/rc.d/rc6.d/
Experts have long recognized a need into break using the past and produce a contemporary, OS independent firmware using support for booting from large disks, and A flexible pre-OS environment, network capacity, and a modular design. The Extended Firmware Interface from Intel is all the result. An industry wide organization had been formed in 2005 to encourage adoption of the EFI spec, and the spec was then renamed Unified EFI. Unified Extended Firmware Interface – The UEFI takes all the concept of all the BIOS to a whole new level. This filesystem is typically between 200 and also 500MB and also formatted as FAT32. Rather than a couple of bytes of assembly code for loading all the OS, each installed OS must have its own bootloader .