- Select and change the default boot target.
- Switch targets immediately for maintenance or recovery.
- Reset the root password if administrative access is lost.
- Troubleshoot common boot issues and examine relevant logs.

What is a systemd target?
A systemd target is a named state that groups together the unit files (services, mounts, sockets, timers, etc.) required to reach a particular operating mode. Think of a target as a destination on a GPS: systemd starts all the units necessary to reach that destination. Common targets map to classic SysV runlevels but are more flexible and expressive.
Common targets and what they provide
emergency.target— The most minimal environment. Typically a root shell on the console with almost nothing else running. Use for severe troubleshooting and recovery when filesystems or system state are compromised.rescue.target— Equivalent to single-user or maintenance mode. Provides a root shell and a minimal set of services; usually no networking or multi-user services.multi-user.target— Standard non-graphical multi-user mode. Networking enabled and system services available, but no graphical display manager.graphical.target— Builds onmulti-user.targetand adds display manager and graphical session services for desktop systems.
Runlevel mappings
Inspecting and controlling targets with systemctl
Use the following commands to inspect, change, or switch targets:systemctl set-defaultchanges the persistent default used at boot.systemctl isolateswitches the running system immediately to the requested target and stops services that are not dependencies of that target; this can drop network connections.systemctl rescueandsystemctl emergencyare convenient shortcuts to enterrescue.targetandemergency.target, respectively.emergencyis more restrictive thanrescue.
When performing immediate target switches on a remote machine, prefer using a console or ensure an out‑of‑band management channel is available. Switching to
rescue or emergency mode can stop networking and disconnect SSH sessions.Resetting the root password when you’re locked out
If you lose administrative access, booting into a minimal target can let you reset the root password. A typical process:- Reboot and interrupt the bootloader (GRUB) to edit the kernel command line (or use your remote console).
- Append
systemd.unit=emergency.target(or boot to rescue/emergency via the boot menu) to drop to a root shell. - Once at the emergency shell, remount the root filesystem read-write:
- Reset the root password:
- If SELinux is enabled, you may need to relabel on next boot:
- Reboot normally:
Always ensure the root filesystem is mounted read-write before changing passwords or system files. Editing kernel boot parameters or selecting emergency mode may vary by distribution and environment — follow your distro’s recovery guidance.
Troubleshooting boot failures
When a system fails to boot properly, gather information before making changes:-
Check the system journal for the current or previous boot:
-
List failed units to find services preventing boot:
- Inspect the boot loader configuration and kernel parameters if hardware or initramfs issues are suspected.
-
Use
systemctl isolate rescue.targetorsystemctl rescueto enter maintenance and diagnose (with caution on remote systems).
Useful references
- systemd man pages:
man systemctl,man systemd.target - systemd documentation
- Distribution recovery guides (check your distro vendor docs for GRUB and SELinux-specific steps)