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:
- Initializes the screen (that swift flicker of light you ignore).
- Checks the keyboard (yes, it’s your RGB keyboard lighting up).
- 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 Adel. Ahmad is a freelance writer and also a backend developer.
Related articles
-
Optimizing Network Speed on Your Webdock KVM Server
A mini article with some kernel tweaks to improve network performance on your server
Last updated: September 6th 2024
-
How to configure Crontab on Linux
In this article we detail how Crontab works and all the available options for configuration along with correct syntax and examples.
Last updated: January 4th 2024
-
How to free up disk space on an Ubuntu Nginx or Apache Web Server
This article outlines useful commands you can run on your server in order to free up disk space.
Last updated: October 16th 2023
-
How to monitor webdock server resources using Prometheus, Grafana, Node Exporter and Prometheus Alert Manager
This guide includes the step by step procedure of installing different packages like Prometheus, Grafana, Node exporter and Alert Manager.
Last updated: December 7th 2022
-
How to Disable IPv6 on Your Webdock Server
The article explain how to disable IPv6 on your Webdock server, both temporarily and permanently.
Last updated: August 13th 2024
-
Automating Initial Server Configuration with Ansible
Read our new article: Learn how to automate your cloud server configuration using Ansible.
Last updated: July 19th 2023
-
Top Tools to Install on Your Ubuntu Web Server
A list of important tools that you can install on your production Ubuntu web server
Last updated: July 19th 2023
-
How To Benchmark Your Server with YABS
A guide to do benchmarking of your server's CPU, network performance, and such using YABS.
Last updated: April 1st 2024
-
Systemd Units - A Comprehensive Guide for Linux Admins
A detailed guide on systemd internals for Linux admins
Last updated: August 13th 2024
-
A Quick Guide to Managing Systemd Services
A short guide that helps you manage systemd services
Last updated: August 13th 2024
-
How to Benchmark PHP Performance on Your Webdock Server
Instructions for bechmarking PHP performance on your Webdock server
Last updated: August 29th 2024
-
Why don't I have the memory or disk allowance that I expect?
In this article we show why inside your instance you may see lower than expected RAM or DISK allowance available. It has all to do with units!
Last updated: November 29th 2024