Chapter 3. Booting into a target system state


To set a permanent boot environment or enter a recovery mode, use systemd targets to have full control over your system functionality. The systemd init system is a set of systemd unit types such as systemd.target, multi-user.target, shutdown.target.

3.1. Target unit files

To group various systemd units through a chain of dependencies during boot process of a system, you need to use targets in systemd. Targets in systemd are groups of related units to act as synchronization points during the start of your system.

Target unit files end with the .target file extension. It represents the systemd targets. For example, the multi-user.target unit starts other essential system services such as NetworkManager (NetworkManager.service) or D-Bus (dbus.service) and activates another target unit named basic.target.

You can set the following systemd targets as default or current targets:

Expand
Table 3.1. Common systemd targets
TargetPurpose

rescue.target

unit target that pulls in the base system and spawns a rescue shell

multi-user.target

unit target for setting up a multi-user system

graphical.target

unit target for setting up a graphical login screen

emergency.target

unit target that starts an emergency shell on the main console

For more information, see systemd.special(7) and systemd.target(5) man pages on your system

To change the default target, you need to modify the current default.target symbolic link to point to the new target unit. When you set a new default target unit, the current target remains unchanged until the next reboot.

During the boot process, the system initializes the systemd target to which default.target points. Then, systemd resolves this link and boots into the defined target. The selected default target unit is present in the /etc/systemd/system/default.target file. Each target has a certain level of functionality and groups other units. Additionally, target units act as synchronization points during boot. The systemd target types include graphical.target, multi-user target, and so on.

Prerequisites

  • You have administrative privileges.

Procedure

  1. Display the current default target unit systemd uses to start the system:

    # systemctl get-default
    Copy to Clipboard Toggle word wrap
    graphical.target
    Copy to Clipboard Toggle word wrap
  2. List the currently loaded targets:

    # systemctl list-units --type target
    Copy to Clipboard Toggle word wrap
  3. Configure the system to use a different target unit by default:

    # systemctl set-default <name>.target
    Copy to Clipboard Toggle word wrap

    Replace <name> with the name of the target unit you want to use by default.

    # systemctl set-default multi-user.target
    Copy to Clipboard Toggle word wrap
    Removed /etc/systemd/system/default.target
    Created symlink /etc/systemd/system/default.target -> /usr/lib/systemd/system/multi-user.target
    Copy to Clipboard Toggle word wrap
  4. Optional: To immediately switch to the new default target unit:

    # systemctl isolate default.target
    Copy to Clipboard Toggle word wrap

Verification

  1. Verify the default target unit:

    # systemctl get-default
    multi-user.target
    Copy to Clipboard Toggle word wrap
  2. Reboot the system.

3.3. Temporarily changing the current target

To troubleshoot or recover the system, you can temporarily change the current target without rebooting the system. To switch to a different target, use the systemctl isolate command.

By selecting or changing these targets, you define and control selective services and units starting during the boot process. Also, you can view the current default, switch targets, or access the emergency shell prompt as needed

Prerequisites

  • You have administrative privileges.

Procedure

  1. Display the list of targets you can select:

    $ systemctl list-units --type target
    Copy to Clipboard Toggle word wrap
  2. Change to a different target unit in the current session:

    # systemctl isolate <name>.target
    Copy to Clipboard Toggle word wrap

    Replace <name> with the name of the target unit you want to use in the current session.

    # systemctl isolate multi-user.target
    Copy to Clipboard Toggle word wrap

    This command starts the target unit named multi-user and all dependent units, and immediately stops all other units that are not part of the new target. As this is a temporary operation, the system will boot again into the default target when you reboot the host. You can only isolate targets that have the AllowIsolate=yes option set in the unit files.

    For details, see the systemctl(1) man page on your system.

3.4. Booting to rescue mode

To troubleshoot or repair the system, you can boot into the rescue mode to enter a single-user environment. This happens when the system fails to reach a later target and the existing booting process fails.

In the rescue mode, apart from not activating network interfaces, the system tries to mount all local file systems and start required system services.

Prerequisites

  • You have administrative privileges.

Procedure

  • Enter the rescue mode:

    # systemctl rescue
    Copy to Clipboard Toggle word wrap
    Broadcast message from root@localhost on pts/0 (Fri 2023-03-24 18:23:15 CEST):
    The system is going down to rescue mode NOW!
    Copy to Clipboard Toggle word wrap
    Note

    This command is similar to systemctl isolate rescue.target, but it also sends an informative message to all users currently logged in the system.

    To prevent systemd from sending a message, enter:

    # systemctl --no-wall rescue
    Copy to Clipboard Toggle word wrap

Troubleshooting

If you cannot boot the system in the rescue mode, you need to boot in the emergency mode to enter in a minimal environment. In the emergency mode, the system mounts the root file system only for reading and initiates essential services. Additionally, the system neither mounts any other local filesystems nor activates network interfaces.

3.5. Troubleshooting the boot process

To enter in the most minimal environment for troubleshooting the boot process, you can select a non-default target at boot time. Choose the emergency mode to enter in the most minimal environment. Changing the target at boot time affects only a single boot event.

Prerequisites

  • You have administrative privileges.

Procedure

  1. Reboot the system, and interrupt the boot loader menu countdown by pressing any key except the Enter key to initiate a normal boot.
  2. Select the kernel entry that you want to start.
  3. Press the e key to edit the current entry.
  4. Navigate to the end of the line that starts with linux and press Ctrl+E to jump to the end of this line.
  5. To select a different boot target, append the systemd.unit= parameter to the end of the line that starts with linux:

    linux ... systemd.unit=<name>.target
    Copy to Clipboard Toggle word wrap

    Replace <name> with the name of the target unit you want to use. For example, systemd.unit=emergency.target

  6. Press Ctrl+X to boot with these settings.
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top