Skip to main content
RunBook Academy

LinuxIX · Boot ProcessTargets

systemd targets and rescue mode

Intermediate⏱ ~10 minbashsystemctl

What you'll learn

  • Distinguish systemd targets from SysV runlevels
  • Boot into rescue, emergency, multi-user, and graphical targets
  • Use systemctl isolate for one-shot state changes
  • Pass kernel arguments to override the default target

Prerequisites

Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09

Not yet marked complete on this device.

systemd targets are collections of units that should reach a particular state together. Targets replace the old SysV runlevels. Knowing which target is right for which recovery is the foundation of every boot-recovery runbook.

The standard targets

TargetReplaces runlevelUse
poweroff.target0Halt the system
rescue.target1Single-user mode with local filesystems mounted
emergency.targetRoot mounted read-only, nothing else started, sulogin root shell
multi-user.target3Multi-user, no GUI, network up
graphical.target5Multi-user with GUI
reboot.target6Reboot
Read-only / Safeactive targets
$ systemctl get-default; systemctl list-units --type=target
graphical.target
UNIT                  LOAD   ACTIVE SUB    DESCRIPTION
basic.target          loaded active active Basic System
cryptsetup.target     loaded active active Local Encrypted Volumes
getty.target          loaded active active Login Prompts
graphical.target      loaded active active Graphical Interface
local-fs.target       loaded active active Local File Systems
multi-user.target     loaded active active Multi-user System
network.target        loaded active active Network
nss-user-lookup.target loaded active active User and Group Name Lookups
remote-fs.target      loaded active active Remote File Systems
slices.target          loaded active active Slices
sockets.target        loaded active active Sockets
swap.target            loaded active active Active SWAP
sysinit.target        loaded active active Early Sysinit
timers.target         loaded active active Timer
...

Illustrative output

Switching targets at runtime

Service impact possibleisolate
$ sudo systemctl isolate rescue.target

Illustrative output

Service impact possibleisolate to multi-user
$ sudo systemctl isolate multi-user.target

Illustrative output

Booting into a specific target

Configuration changeset-default
$ systemctl set-default multi-user.target
Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/multi-user.target.

Illustrative output

Kernel command-line overrides

For a one-time boot into a non-default target, append to the kernel command line in GRUB:

systemd.unit=rescue.target
Kernel parameterEffect
systemd.unit=rescue.targetBoot into rescue.target regardless of default
systemd.unit=multi-user.targetBoot into multi-user.target
systemd.unit=emergency.targetBoot into emergency.target (even less than rescue)
systemd.unit=rescue.serviceBoot into a single service rather than a target
init=/bin/bashSkip systemd entirely; drop to a shell
rescue, single, s, S, 1Alias for systemd.unit=rescue.target
emergency, -bAlias for systemd.unit=emergency.target
2, 3, 4Alias for systemd.unit=multi-user.target
5Alias for systemd.unit=graphical.target
rd.rescue, rd.emergencyThe same two states, but entered inside the initrd

Procedure for a remote host stuck in a target

  1. Connect via OOB (IPMI, iDRAC, iLO, Redfish console) — SSH may be down
  2. Reboot to GRUB menu — usually Esc, Shift, or F12 depending on firmware
  3. **Press e to edit the kernel command line** of the default entry
  4. **Append systemd.unit=rescue.target** to the linux line (after ro or at the end)
  5. Ctrl-X or F10 to boot the modified entry
  6. At the rescue shell, diagnose. Read-only filesystems are mounted; the journal is available; LVM is available if you load the modules
  7. Fix the problem. Common fixes: remove a unit file, repair a filesystem, restore a config from backup
  8. Reboot with systemctl reboot to return to the default target
  9. Verify with systemctl is-active SERVICE that the affected service is now running.

Knowledge check

Knowledge check · 4 questions

  1. Q1. What is the difference between rescue.target and emergency.target?

  2. Q2. `systemd.unit=rescue.target` on the kernel command line boots into rescue mode at the next boot.

  3. Q3. Which of the following are correct recovery target practices? Select all that apply.

  4. Q4. A host will not boot because one line in /etc/fstab references a disk that no longer exists. You are on the OOB console. Which kernel parameter gets you a usable shell on the first attempt?

Passing score: 75%. Answers are checked in this browser.