Skip to content

Click on each book below to review & buy on Amazon.

As an Amazon Associate, I earn from qualifying purchases.


RHCSA - Operate Running Systems: Boot Systems Into Different Targets Manually

Ensure that for production systems you always communicate with any stakeholders before booting into different targets.

Targets

In systemd-based Linux distributions, you can manually boot systems into different targets using the systemctl isolate command. Targets represent specific system states or sets of services that can be activated or deactivated to manage the system's behavior during boot and runtime.

Below is a table of the typical targets you can boot into:

Target Description
default.target The default target that is reached after the system has finished booting. It typically starts the system in the default runlevel.
emergency.target This target is used in emergency situations where the system is in an unusable state. It provides a minimal environment for recovery tasks.
graphical.target This target is used to start the system with a graphical user interface (GUI) environment, such as X11 or Wayland.
multi-user.target This target is used to start the system with a multi-user environment, without a GUI. It provides a text-based login prompt.
rescue.target This target is similar to the emergency.target, but it provides a more complete environment for performing system recovery tasks.

Check Current Target

Before switching to a different target, you can check the current target using the systemctl get-default command:

Check the current default target:

systemctl get-default

The output will display the current default target, which is the target the system boots into by default.If following along with the course the output should display graphical.target.

List Available Targets to Boot into (Isolate)

You can list available targets on your system using the systemctl list-units --type=target command, however this will list all targets and not just the ones that can be isolated. The AllowIsolate=yes setting in the targets unit file determines if the target can be isolated.

List all targets:

systemctl list-units --type=target

This command will show a list of targets along with their current state.

Locate all targets that can be isolated:

grep -E 'AllowIsolate=(yes|'yes'|"yes")' /usr/lib/systemd/system/*.target

This command will search all target files in the /usr/lib/systemd/system directory that have AllowIsolate set to yes.

Switch to a Different Target

To switch to a different target manually, you use the systemctl isolate command followed by the target name.

Switch to the multi-user.target:

sudo systemctl isolate multi-user.target

The system will switch to the Multi User Target, providing you with a terminal login only.

Switch Back to Default Target

Use the systemctl isolate command again to switch back to the default target.

Retunr to default.target:

sudo systemctl isolate default.target

Support DTV Linux

Click on each book below to review & buy on Amazon. As an Amazon Associate, I earn from qualifying purchases.

NordVPN ®: Elevate your online privacy and security. Grab our Special Offer to safeguard your data on public Wi-Fi and secure your devices. I may earn a commission on purchases made through this link.