It is a high-level review of the Linux boot process in details and short step by step which helps you remember the Linux boot process for always.
Linux Boot Process
Let’s begin it from BIOS and finished them with Systemd which determine the system targets or Runlevels in Linux. This is just a short and informative explanation, for in deep details of Linux boot process, head up to wiki.
1. BIOS: The BIOS, basic input/output System perform the POST or power on self-test to do the power cycle the system, detect and initialize system hardware components.
2. MBR :The MBR or master boot record is located in the 1st sector of the bootable disk, typically /dev/hda, or /dev/sda. It is less than 512 bytes in size and has three components. A primary boot loader info in 1st 446 bytes, a partition table info in next 64 bytes and an MBR validation check in last 2 bytes.
It is the fist sector of any boo-table disk, loads the GRUB2 boot loader into memory.
3. GRUB2: The GRUB starts searching the vmlinuz which is the Linux kernel compressed image, and loads into memory then extract the contents of initramfs image.
4. KERNEL: The Kernel mounts the root file system as specified in the “root=” in grub.conf then executes the /sbin/init program
5. SYSTEMD: The Systemd (old init) determine the system target and brings up the system defined target.
6. Run-level: A run level is one of the modes that a Unix-based, dedicated server or a VPS server OS will run on. Each runlevel has a certain number of services stopped or started, giving the user control over the behaviour of the machine. Conventionally, seven runlevels exist, numbered from zero to six. Depending on your default run level setting, the system will execute the programs from one of the following
|0||Halt||Shuts down system|
|1||Single-User Mode||Does not configure network interfaces, start daemons, or allow non-root logins|
|2||Multi-User Mode||Does not configure network interfaces or start daemons.|
|3||Multi-User Mode with Networking||Starts the system normally.|
|5||X11||As runlevel 3 + display manager(X)|
|6||Reboot||Reboots the system|
Learn more about Linux Command Line with examples.
A run level defines the state of the machine after boot. Different runlevels are typically assigned (not necessarily in any particular order) to the single-user mode, multi-user mode without network services started, multi-user mode with network services started, system shutdown, and system reboot system states. The exact setup of these configurations varies between operating systems and Linux distributions.