Highlights
- Boot Sequence Mastery: Learn how the Linux kernel initializes the system and hands over control to the init process to reach a specific target.
- Transition from Runlevels: Understand the evolution from legacy Linux runlevels to the modern systemd architecture used in current distributions.
- Environment Selection: Discover how to identify and change boot mode Linux relies on for either text-based or graphical environments.
- Service Management: Learn how the multi-user target provides a full networking environment without the overhead of a GUI.
- Critical Maintenance: Master the use of rescue mode Linux for performing system repairs and root-level administrative tasks safely.
Linux is an open-source operating system that’s highly versatile and customizable. It is often used in server environments due to its reliability and security features. It is particularly popular among developers and IT professionals, who appreciate its flexibility, stability, and versatility.
In this blog, we will explore the different Linux boot modes and learn how to manage system states effectively. Understanding these modes is crucial for performing maintenance, troubleshooting, and optimizing server performance.
Linux Boot Process
A Linux boot process is initiated when the computer is turned on, and it goes through several stages before the user can interact with the system's interface. The process typically starts with the BIOS (Basic Input/Output System) performing a Power-On Self-Test (POST) to check for hardware errors. After that, the boot loader is loaded into memory, which is responsible for loading the operating system kernel.
Once the kernel is loaded, it initializes the system and loads the necessary drivers and modules. The kernel then starts the system's init process, which is responsible for starting the system's services and processes based on the target system configuration. The target system defines the desired behavior of the system during the boot process, and it can be customized as per the user's requirement.
What is a System Target?
System target in Linux refers to the specific state or mode in which the operating system is configured. Historically, these states were managed via Linux runlevels, but modern systems utilize systemd targets. It is responsible for managing various services, processes, and applications that are required for a particular purpose or task.
The target system helps the user define the desired behavior during the boot process and provides a convenient way to manage the system's functionality. It can be changed or modified per the user's requirement and accessed through various tools and commands provided by the Linux operating system.
List of the Commonly Used System Targets
Modern Linux systems map traditional Linux runlevels to specific systemd targets. Below are some of the most common ones:
It’s important to note that you must have a password set for the root user to use these targets. If the root user has no password, you cannot use these targets as you cannot log in as root.
We can check the default target by running the following command:
systemctl get-defaultChanging the Default Boot Target
To change the default boot target in Linux, you will need to open the grub configuration file. First, open the terminal by pressing Ctrl + Alt + T. Next, type in sudo nano /etc/default/grub and press enter. This will open the grub configuration file in the nano text editor.
Once the file is open, locate the line that reads GRUB_DEFAULT=0. This line specifies the default boot target. Change the number to match the target you want to set as the default. For example, if you want to set the fourth target as the default, change the line to read GRUB_DEFAULT=3.
After making the change, save the file by pressing Ctrl + X, then Y, then Enter. Finally, update the grub configuration by running the command sudo update-grub. Now, the next time you boot your Linux system, it will automatically boot into your desired target.
Let's see another way of changing the boot target.
Assume the system has a default boot system set as graphical.target. If we don't need our operating system to load up a graphical user interface, we can change boot mode Linux starts with by running:
sudo systemctl set-default multi-user.targetThe multi-user.target makes Linux boot normally, with all of its daemons, database server utilities, and whatever we might have configured. However the graphical interface will be skipped. Everything will be text-based. It’s called multi-user because while Linux is booted in this mode, multiple users can log in and use the system simultaneously. multi-user.target also turns on network services, so the machine can access the Internet and local network.
Change a System into a Different Target Without Rebooting
Now imagine we want to get back to our graphical desktop. Maybe we need to use a 3D modeling application for 1 hour. Instead of changing the default boot target, then rebooting, we can change boot mode Linux is currently running in without a reboot. For instance, we can switch back to the graphical.target with:
sudo systemctl isolate graphical.targetThis will load up all the graphical applications, and we will get access to our graphical user interface.
Other commonly used systemd targets include emergency.target and rescue.target.
emergency.target Loads up as few programs as possible. This can be useful for debugging in situations where the programs loaded by the other targets are making your system unstable. If you boot into this target, the root filesystem will be mounted as read-only.
rescue.target In this mode, a few essential services are loaded, and you are dropped to a root shell. Simply put, a few more programs are loaded than in emergency.target, but fewer than are loaded in multi-user.target. In this root shell, you can type commands as the system administrator, create database backups while the database is not online, fix system settings, etc.
Enroll in our Linux Basics Course to learn more Linux concepts.

Conclusion
In this article, you've learned how Linux systems boot up and the different Linux boot modes available through systemd targets. Mastering these states is important if you plan to work with Linux to build, test, or troubleshoot systems efficiently. Remember that changing the default target via systemctl ensures your desired environment is ready every time you power on.
More on Linux:
- How to Force Reboot Linux from Command Line
- How to Create a Soft (Symbolic) Link in Linux
- How to List All Groups in Linux
- How to Unzip Files to a Specific Directory in Linux
- How to Make a Bash Script File Executable in Linux
- How to Search Packages With Apt Search Command
- How to Run Shell Script (.sh) Files in Linux
FAQs
Q1: What is the difference between Linux runlevels and systemd targets?
Linux runlevels (0-6) are the legacy way of defining system states in older SysVinit systems. systemd targets (like .target files) are the modern equivalent used by most current Linux distributions to manage services and dependencies more flexibly.
Q2: Why should I boot into the multi-user target?
The multi-user target is ideal for servers. It provides a full multi-user environment with networking and all background services enabled but skips the graphical user interface, saving significant system resources (CPU and RAM).
Q3: When is it necessary to use rescue mode Linux?
You should use rescue mode Linux (via rescue.target) when you need to perform critical maintenance, such as fixing a broken /etc/fstab file, resetting a lost root password, or repairing the filesystem while most non-essential services are stopped.
Q4: How can I temporarily change boot mode Linux is using without restarting?
You can use the systemctl isolate command (e.g., sudo systemctl isolate multi-user.target) to immediately switch the system's running state to a different target without needing to reboot the hardware.
Q5: How do I verify which of the Linux boot modes is my current default?
You can easily check your system's default boot behavior by running the command systemctl get-default in your terminal. This will return the name of the target that the system will enter upon its next startup.

Discussion