Before the operating system begins to load, its process is managed by a special program — the bootloader, which initiates the kernel’s startup and hands over control to it. In the Linux ecosystem, the most well-known and widely used bootloader is GRUB — a flexible and powerful tool that supports multi-booting, various file systems, and compatibility with both BIOS and UEFI. GRUB essentially sets the stage for the entire boot process, determining which system or configuration will be activated when the computer is started.
Who? What's that?
GRUB (GNU GRUB, short for "GRand Unified Bootloader") is an essential utility that manages the boot process, allowing your machine to start one or several operating systems. It’s automatically installed during most Linux setup procedures and is the first program to take control after BIOS or UEFI finishes initializing your hardware. Depending on your setup, GRUB will either present a menu to choose between operating systems or directly launch the Linux kernel without needing user input.
What it is used for?
GRUB is more than just "start Linux." It can:
- Display a system selection menu in multi-boot setups (Linux + Windows, multiple Linux distributions, etc.),
- Allow you to manually specify the kernel and boot parameters,
- Boot from various file systems, including ext4, Btrfs, FAT, NTFS, and others,
- Support both classic BIOS and modern UEFI boot modes,
- Help recover a system when normal booting fails (via a command line interface).
How does GRUB work?
The computer’s boot process happens in several stages:
- BIOS or UEFI – The first stage of the boot process is handled by the BIOS or UEFI, which performs essential hardware checks to ensure everything is functioning properly. After these initial diagnostics, it locates and loads the bootloader to proceed with the system's startup.
- GRUB Stage 1 – On legacy systems, the GRUB bootloader is loaded from the Master Boot Record (MBR), while on modern systems using UEFI, it’s loaded from the EFI system partition. This stage is responsible for initiating the process but doesn't handle the full complexity of booting the system.
- GRUB Stage 2 – This is where GRUB takes full control, performing most of its critical functions. It loads the boot configuration file, presenting the user with a menu if there are multiple operating systems or kernel configurations available. Once the user selects an option, GRUB loads the necessary kernel and prepares the system for booting.
- Operating System Kernel – Once the appropriate kernel (such as Linux) is selected, it is loaded into memory. At this point, the kernel takes full control of the system, initializing the rest
In conclusion, the boot process is a carefully orchestrated sequence of events that involves multiple stages to transition from hardware initialization to a fully operational operating system. Each stage, from BIOS or UEFI performing hardware checks to GRUB handling bootloader tasks and finally loading the operating system kernel, plays a crucial role in ensuring that the system starts correctly. Understanding this sequence helps in troubleshooting boot-related issues and gaining a deeper insight into how operating systems interact with hardware during the startup process.
Configuring and Recovering GRUB
How can i find GRUB’s configuration file?
The main GRUB configuration file is located at:
/boot/grub/grub.cfg
However, it is not recommended to edit this file directly because it is automatically generated by the system. Instead, you should modify:
/etc/default/grub
After making changes, update the bootloader configuration using:
sudo update-grub
Example configuration of /etc/default/grub:
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -d -s 2>/dev/null || echo Ubuntu`
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="acpi=force"
How to recover GRUB if it stops working?
If after installing Windows or replacing a drive Linux no longer boots, GRUB might have been overwritten. You can recover it using a Live USB distribution.
Run the following commands:
sudo mount /dev/sdXn /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sdX
Then, enter the installed system's environment and update the configuration:
sudo chroot /mnt
update-grub
GRUB and Multi-OS Selection
If you have multiple operating systems installed on your machine, GRUB will automatically create a boot menu allowing you to choose which OS to launch — for example:
- Ubuntu
- Windows 10
- Advanced options for Ubuntu
You can customize the order and appearance of this menu via the /etc/default/grub file and update it using update-grub. You can also set the default system and adjust the timeout before automatic boot.
GRUB 1 vs GRUB 2
Today, most systems use GRUB 2 — a more flexible and modular version that supports modern boot formats. The older GRUB (Legacy) is now obsolete and rarely used.
Conclusion
GRUB is not just a bootloader — it is a critical component of the Linux ecosystem, providing flexible control over operating system startup. Thanks to its wide range of features, it fits both simple user systems and complex setups with multiple OSs and non-standard boot conditions.
Proper GRUB configuration can not only speed up the boot process but also help prevent potential issues related to multi-boot setups, system updates, or recovery after failures.
While its configuration might seem complex at first glance, understanding the basic principles — like editing /etc/default/grub instead of directly modifying grub.cfg — significantly simplifies working with this powerful tool.
By mastering GRUB, you gain not only control over your system's boot process but also increase its resilience to unexpected changes and failures.
Looking for reliable and flexible cloud solutions?
With Serverspace, you can quickly rent virtual servers tailored to your needs — from lightweight instances for simple projects to powerful configurations for demanding applications. Easily deploy isolated VPC environments for maximum security and network control. Plus, explore a comprehensive library of detailed tutorials, how-to guides, and technical articles that will help you set up, configure, and optimize your infrastructure at every stage. Whether you're launching your first Linux server, managing multi-OS boot environments, or building a complex cloud architecture, Serverspace offers the performance, scalability, and expert resources to support your success. Start building today with intuitive tools, flexible billing, and 24/7 technical support.
Learn with us!
The Serverspace Glossary is an invaluable resource for users diving into the world of cloud computing, server management, and DevOps. It serves as a comprehensive guide, providing clear and concise definitions for essential terms and concepts that are frequently encountered within cloud technology, IT infrastructure, and the broader tech industry. This glossary is ideal for a wide range of users, from beginners just starting with cloud solutions to seasoned professionals looking to refresh or expand their knowledge.
Covering an extensive range of topics, the glossary includes key terms related to server virtualization, networking, storage solutions, security protocols, containers, and cloud-native technologies. Each entry is carefully crafted to help users quickly grasp complex technical terminology, ensuring they can navigate through technical documentation, guides, and tutorials with ease. Additionally, the glossary simplifies advanced concepts, making them accessible to individuals without a deep technical background, while also providing value to those looking for more detailed insights.
One of the standout features of the Serverspace Glossary is its commitment to staying current with the latest industry trends. It is regularly updated to reflect the ever-evolving landscape of cloud services, virtualization, automation tools, and emerging technologies. This ensures that users have access to the most up-to-date definitions, best practices, and terminology in the field, making it a vital resource for anyone engaged with cloud computing and server management