What Happens When You Power-On a Linux Machine?

Last updated: February 3rd 2025

Introduction

There is a small, yet powerfull firmware embeded to your motherboard that is responsable for bringing your device to life known as BIOS (Basic Input/Output System).

You could imagine booting a linux machine, is just like Domino toppling, where each step triggers the step after it, and if a single step fails, the entire procees fails.

This article describes the stages involved.

Different Stages Involved

Stage 1: The Firmware’s 5-Second Hustle (BIOS/UEFI)

When you click the power button, the firmware (BIOS/UEFI) triggers POST (Power-On Self-Test). This is its “morning coffee” routine:

  1. Initializes the screen (that swift flicker of light you ignore).
  2. Checks the keyboard (yes, it’s your RGB keyboard lighting up).
  3. Tests the RAM (if this fails, you’ll hear angry beeps – BIOS’s way of screaming).

After doing all that, our tiny tired friend – the firmware – collapses, exhausted. It’s done its job. Now it throws the baton to the next hero: the bootloader.

Stage 2: The Bootloader’s Sprint

Our hero, GRUB (Grand Unified Bootloader), snatches the baton and sprints to the MBR (Master Boot Record). This is a 512-byte note sitting at sector 0 of your hard drive.

Inside the MBR, GRUB finds two things:
1. A map (partition table) pointing to where your OS lives.
2. A tiny script (bootloader code) yelling: “Hey, load the next stage from this secret compartment!”

But wait – why does GRUB need a “second stage”? Because the MBR is too small (512 bytes!) to hold GRUB’s full code. So, GRUB Stage 1.5 hides in a 1MB gap right after the MBR (this is where people confuse the MBR size with the reserved space).

Stage 3: The OS Treasure Hunt

GRUB now shouts: “Where’s the bootable drive?” The firmware (before dying) left a list of devices to check:
HDD/SSD
USB
CD-ROM

GRUB follows the firmware’s will, locates the boot partition, and finds the Linux kernel and initramfs (a temporary root filesystem stuffed into RAM).

Wait, Why That “1MB Partition”?

When installing Linux, you might see a tiny partition (often 1MB– modern systems reserve more). This is GRUB’s playground, NOT the MBR! It’s where GRUB stores:
- Filesystem drivers (to read /boot).
- Fancy themes (because even bootloaders need swag).
- Kernel-loading instructions.

The MBR is just the starting gun. The real race happens in this reserved space.

The Domino Effect Fails When…

  • MBR is corrupted: GRUB trips, screams “Error: no such partition”, and your screen becomes a sad black rectangle.
  • Boot partition missing: GRUB wanders aimlessly, like a lost tourist without Google Maps.
  • Kernel not found: The dominos stop, and you get a panic attack (or a kernel panic).

Why Should You Care?

  • Dual-booting: GRUB lets you pick between Linux, Windows, or that obscure BSD OS you installed for “research”.
  • Recovery: If the MBR dies, your OS is buried. Fix it with grub-install or cry.
  • UEFI vs BIOS: Newer systems use UEFI and GPT (not MBR!), skipping this ancient drama. But that’s another story.

Conclusion

This article outlined the stages involved in the bootup process of a Linux system.

The boot process is a fragile chain of trust. Break one link, and your machine becomes a very expensive paperweight. Now go forth, and fix your friend’s “broken” laptop with this knowledge 💻🔧.

This article was written by Ahmad AdelAhmad is a freelance writer and also a backend developer.

Related articles