Skip to content

How to Boot Linux into Rescue, Emergency or Recovery Mode

Updated 7 min read

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/fstab cannot be mounted (local-fs.target has OnFailure=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.

  1. 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.
  2. Restart the server (reboot, or restart the VPS from Virtualizor) and watch the console.
  3. 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 Shift while a BIOS system starts, or press Esc (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)

  1. Select the entry you normally boot and press e.
  2. Go to the line that starts with linux and press Ctrl+E to jump to its end.
  3. Type a space and systemd.unit=rescue.target, or systemd.unit=emergency.target. The short forms single or 1 (rescue) and emergency do the same, according to the systemd manual.
  4. Press Ctrl+X to boot (Esc cancels your changes). The change is for this boot only.
  5. 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 with You are in emergency mode. AlmaLinux and Rocky Linux use Give root password for maintenance.

3. Recovery mode on Ubuntu

  1. In the GRUB menu, choose Advanced options for Ubuntu, then the entry that ends with (recovery mode).
  2. That entry adds recovery nomodeset to the kernel line (we read /etc/grub.d/10_linux of GRUB 2.12 on Ubuntu 24.04 and 2.14 on 26.04). The friendly-recovery package, part of the standard Ubuntu install, sees the word recovery and opens the Recovery Menu instead of the normal boot.
  3. 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
  4. 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, run mount -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

  1. Make the root file system writable and mount the rest:
    mount -o remount,rw /
    mount -a
    If an /etc/fstab line is wrong, mount -a prints an error for it.
  2. Read the errors of the failed boot: journalctl -xb, or systemctl --failed.
  3. Fix the problem. For a bad /etc/fstab line, put # in front of it (or add nofail to its options for a disk that is not always there), then run systemctl daemon-reload.
  4. Leave: systemctl reboot restarts the server; systemctl default (or exit) 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 linux line:
    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 to Press Enter for system maintenance and 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/bash to the linux line, then run mount -o remount,rw /, passwd root and, on SELinux systems such as AlmaLinux and Rocky Linux, touch /.autorelabel, then exec /sbin/init to continue booting.
  • RHEL, AlmaLinux and Rocky Linux: the full steps, including rd.break on version 8 and 9, are in how to boot into single user mode on RHEL 8, 9 and 10. On version 10 the rd.break shell itself asks for the root password (dracut 107 starts it through sulogin), so use init=/bin/bash there.

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.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket