Checking the Default Boot Target
The default boot target determines which services and environments are loaded during system startup. To see the current default boot target, run the following command:Changing the Default Boot Target
Running a graphical session typically consumes more system resources. If you prefer a lighter, text-based mode (multi-user target) for regular operations, you can change the default boot target. The multi-user target loads essential services without initializing the graphical desktop, making it ideal for servers and environments where resource optimization is key. To change the default boot target to multi-user, execute:In multi-user mode, you boot into a text-based interface where network services remain active, and multiple users can log in simultaneously.
Booting into the Multi-User Target
After setting multi-user as the default, a system reboot will present you with a text-based login prompt instead of a graphical interface. Log in with your username and password to access the command-line environment. An example session might look like:Switching Targets Without Rebooting
Sometimes, you may need to temporarily switch the operating mode without rebooting your system. This can be useful if you require access to a graphical application while normally operating in multi-user mode. You can achieve this by using the systemdisolate directive.
For instance, to temporarily switch from the multi-user target to the graphical target, run:
Overview of System Targets
Below is a table summarizing the available systemd targets discussed in this guide:| Boot Target | Description | Command Example |
|---|---|---|
| graphical.target | Boots the system with a graphical login and desktop environment. | sudo systemctl set-default graphical.target |
| multi-user.target | Boots the system in a text-based manner with essential services enabled. | sudo systemctl set-default multi-user.target |
| emergency.target | Boots the system with minimal services and mounts the root filesystem as read-only for debugging purposes. | sudo systemctl isolate emergency.target |
| rescue.target | Boots the system with few additional services, providing a root shell for maintenance tasks. | sudo systemctl isolate rescue.target |
Special Modes for Troubleshooting
For system maintenance and troubleshooting, systemd offers specialized targets.Emergency Target
The emergency target boots the system with minimal services and mounts the root filesystem as read-only. This mode is particularly useful when system instability prevents normal booting or when troubleshooting critical issues. To activate the emergency target:Rescue Target
The rescue target starts the system with a slightly broader service set and provides you with a root shell. Use this mode to perform system repairs, create backups, or adjust configurations. To activate the rescue target:Ensure that a root password is set before using the emergency or rescue targets; without a root password, you won’t be able to log in as root.
Restoring the Graphical Boot Target
If you decide to revert to a graphical boot interface, you can change the default target back to graphical mode with the following command:This guide has detailed the process of booting your Linux system into different operating modes with systemd. Continue to enhance your Linux administration skills and tailor the boot configurations to your system requirements through further practice and exploration. For more information on systemd and Linux boot processes, consider exploring additional resources: