LinuxIX · Boot ProcessTargets
systemd targets and rescue mode
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
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
| Target | Replaces runlevel | Use |
|---|---|---|
poweroff.target | 0 | Halt the system |
rescue.target | 1 | Single-user mode with local filesystems mounted |
emergency.target | – | Root mounted read-only, nothing else started, sulogin root shell |
multi-user.target | 3 | Multi-user, no GUI, network up |
graphical.target | 5 | Multi-user with GUI |
reboot.target | 6 | Reboot |
$ systemctl get-default; systemctl list-units --type=targetgraphical.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
$ sudo systemctl isolate rescue.targetIllustrative output
$ sudo systemctl isolate multi-user.targetIllustrative output
Booting into a specific target
$ systemctl set-default multi-user.targetRemoved /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 parameter | Effect |
|---|---|
systemd.unit=rescue.target | Boot into rescue.target regardless of default |
systemd.unit=multi-user.target | Boot into multi-user.target |
systemd.unit=emergency.target | Boot into emergency.target (even less than rescue) |
systemd.unit=rescue.service | Boot into a single service rather than a target |
init=/bin/bash | Skip systemd entirely; drop to a shell |
rescue, single, s, S, 1 | Alias for systemd.unit=rescue.target |
emergency, -b | Alias for systemd.unit=emergency.target |
2, 3, 4 | Alias for systemd.unit=multi-user.target |
5 | Alias for systemd.unit=graphical.target |
rd.rescue, rd.emergency | The same two states, but entered inside the initrd |
Procedure for a remote host stuck in a target
- Connect via OOB (IPMI, iDRAC, iLO, Redfish console) — SSH may be down
- Reboot to GRUB menu — usually Esc, Shift, or F12 depending on firmware
- **Press
eto edit the kernel command line** of the default entry - **Append
systemd.unit=rescue.target** to thelinuxline (afterroor at the end) - Ctrl-X or F10 to boot the modified entry
- At the rescue shell, diagnose. Read-only filesystems are mounted; the journal is available; LVM is available if you load the modules
- Fix the problem. Common fixes: remove a unit file, repair a filesystem, restore a config from backup
- Reboot with
systemctl rebootto return to the default target - Verify with systemctl is-active SERVICE that the affected service is now running.
Knowledge check
Knowledge check · 4 questions
Q1. What is the difference between rescue.target and emergency.target?
Q2. `systemd.unit=rescue.target` on the kernel command line boots into rescue mode at the next boot.
Q3. Which of the following are correct recovery target practices? Select all that apply.
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.