Updated: 18 October 2026 · Applies to: Linux with systemd: tested on Debian 13, Ubuntu 24.04 and 26.04, AlmaLinux 9.8 and 10.2; RHEL and Rocky Linux according to Red Hat
To boot Linux into rescue mode, stop the GRUB menu, press e, add systemd.unit=rescue.target to the end of the line that starts with linux and press Ctrl+X. For emergency mode, add systemd.unit=emergency.target instead. Both ask for the root password and work the same on Debian, Ubuntu, AlmaLinux, Rocky Linux, RHEL and Fedora. On Debian and Ubuntu you can also choose Advanced options and then the entry that ends with (recovery mode) in the GRUB menu.
CentOS Linux 7 and 8 are end of life; the steps are the same there, but the kernel line on CentOS 7 can start with linux16.
Rescue, emergency or recovery mode: which one?
- Rescue mode (
rescue.target, the old single user mode or runlevel 1): mounts all file systems and starts only the most basic services, without network. Use it for most repairs. - Emergency mode (
emergency.target): nothing is started and nothing extra is mounted; the root file system may still be read-only. systemd also lands here by itself when a file system in/etc/fstabcannot be mounted (local-fs.targethasOnFailure=emergency.target), which is why you may suddenly see "You are in emergency mode". - Recovery mode on Debian and Ubuntu: a ready-made GRUB entry. On Debian it boots rescue mode; on Ubuntu it opens a recovery menu first.
- A rescue system: a separate small Linux that boots from an ISO or from your provider's panel. Use it when the installed system does not boot at all or GRUB is broken.
1. Open the console and reach the GRUB menu
These modes have no network, so you need a console that shows the server's screen, not SSH.
- On a Ucartz VPS, open the VNC console from the client area, as shown in how to access your VPS via VNC in Virtualizor. On a dedicated server, use the IPMI or KVM console if your server has one, or ask our support team.
- Restart the server (
reboot, or restart the VPS from Virtualizor) and watch the console. - When the GRUB menu appears, press an arrow key to stop the countdown. Ubuntu hides the menu by default: according to Ubuntu's documentation, hold
Shiftwhile a BIOS system starts, or pressEsc(several times if needed) on a UEFI system. If the menu flashes past, see how to change GRUB kernel parameters before booting.
2. Boot into rescue or emergency mode (any distribution)
- Select the entry you normally boot and press
e. - Go to the line that starts with
linuxand pressCtrl+Eto jump to its end. - Type a space and
systemd.unit=rescue.target, orsystemd.unit=emergency.target. The short formssingleor1(rescue) andemergencydo the same, according to the systemd manual. - Press
Ctrl+Xto boot (Esccancels your changes). The change is for this boot only. - Enter the root password at the prompt. On Debian 13 (systemd 257) the console showed:
You are in rescue mode. After logging in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, or "exit" to continue bootup. Enter root password for system maintenance (or press Control-D to continue):
Emergency mode prints the same withYou are in emergency mode. AlmaLinux and Rocky Linux useGive root password for maintenance.
3. Recovery mode on Ubuntu
- In the GRUB menu, choose Advanced options for Ubuntu, then the entry that ends with (recovery mode).
- That entry adds
recovery nomodesetto the kernel line (we read/etc/grub.d/10_linuxof GRUB 2.12 on Ubuntu 24.04 and 2.14 on 26.04). Thefriendly-recoverypackage, part of the standard Ubuntu install, sees the wordrecoveryand opens the Recovery Menu instead of the normal boot. - Pick an option with the arrow keys. In friendly-recovery 0.2.42 (Ubuntu 24.04 and 26.04) they are:
- resume: Resume normal boot
- clean: Try to make free space
- dpkg: Repair broken packages
- fsck: Check all file systems
- grub: Update grub bootloader
- network: Enable networking
- root: Drop to root shell prompt
- system-summary: System summary
- The menu starts with the disk read-only (its title says
filesystem state: read-only). Options that need to write first warn that continuing will remount/read-write and mount the other file systems in/etc/fstab. In the root shell, runmount -o remount,rw /yourself before you edit files.
Ubuntu locks the root account by default. The root option runs sulogin, the same program rescue mode uses, and in our rescue mode tests with the locked root account of Ubuntu 24.04 and 26.04 it printed Press Enter for maintenance (26.04: Press Enter for system maintenance) and gave a root shell without a password. If you have set a root password, it asks for it. If friendly-recovery is not installed, the recovery entry uses single instead and you get plain rescue mode.
4. Recovery mode on Debian
Choose Advanced options for Debian GNU/Linux, then the entry that ends with (recovery mode). It adds single to the kernel line (GRUB 2.12 on Debian 13), which is rescue mode: booting systemd with single on Debian 13 logged Queued start job for default target rescue.target. Enter the root password at the prompt shown in section 2 and repair the system as in section 5.
If you left the root password empty when you installed Debian (so your first user got sudo instead), the root account is locked and recovery mode stops with:
Cannot open access to console, the root account is locked. See sulogin(8) man page for more details. Press Enter to continue.
Pressing Enter just continues the normal boot. See section 6 for the way round it. If the recovery entries are missing from the menu, /etc/default/grub probably contains GRUB_DISABLE_RECOVERY="true".
5. Repair the system and leave
- Make the root file system writable and mount the rest:
mount -o remount,rw / mount -a
If an/etc/fstabline is wrong,mount -aprints an error for it. - Read the errors of the failed boot:
journalctl -xb, orsystemctl --failed. - Fix the problem. For a bad
/etc/fstabline, put#in front of it (or addnofailto its options for a disk that is not always there), then runsystemctl daemon-reload. - Leave:
systemctl rebootrestarts the server;systemctl default(orexit) continues to the normal system.
You can also switch a running system into these modes with systemctl rescue or systemctl emergency. That stops the network and your SSH session, so only do it from the console.
6. Root account locked or password forgotten
- Root is locked (Debian without a root password, or a RHEL-family server where root login is disabled): add both options to the
linuxline:systemd.unit=rescue.target systemd.setenv=SYSTEMD_SULOGIN_FORCE=1
According to the systemd documentation, this skips the password question when the root account is locked. On Debian 13 the prompt changed toPress Enter for system maintenanceand gave a root shell; AlmaLinux 9.8 and 10.2 behaved the same in our tests for KB 769. It does not help when root has a password you have forgotten. - Root password forgotten: on a Ucartz VPS the quickest way is changing the VPS root password from the client area. From the boot menu, add
init=/bin/bashto thelinuxline, then runmount -o remount,rw /,passwd rootand, on SELinux systems such as AlmaLinux and Rocky Linux,touch /.autorelabel, thenexec /sbin/initto continue booting. - RHEL, AlmaLinux and Rocky Linux: the full steps, including
rd.breakon version 8 and 9, are in how to boot into single user mode on RHEL 8, 9 and 10. On version 10 therd.breakshell itself asks for the root password (dracut 107 starts it throughsulogin), so useinit=/bin/bashthere.
Anyone who can reach your console can use these steps, and on Ubuntu recovery mode even opens a root shell without a password. Keep console access to yourself, or protect GRUB with a password.
When the server does not boot at all
If GRUB itself is missing or broken, or you see a grub rescue> prompt, boot a rescue system instead. On a Ucartz VPS, see how to enable rescue mode for your VPS using Virtualizor; then mount your disk and repair it, for example with reinstall GRUB2 from rescue mode or the commands in GRUB rescue commands.
Official documentation: systemd.special (rescue.target and emergency.target) and Red Hat: managing systemd.