Interview Prep/Linux/Boot Process & Kernel

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

IntermediateConceptBoot Process & Kernel
Answer

In one line: Both are repair modes. rescue.target gives you a minimal working system; emergency.target gives you the absolute bare minimum when even that can't start.

The difference:

  • rescue.target — mounts all your disks, starts a few basic services, and gives you a root shell. Use it to fix things like a wrong password or a broken service.
  • emergency.target — mounts only the root disk, in read-only mode, and starts nothing else. Use it when the system can't even mount its disks — for example, a wrong entry in /etc/fstab.

Example — booting into these modes:

At the GRUB menu, press e, go to the line starting with linux, add one of these at the end, and press Ctrl+X:

systemd.unit=rescue.target
systemd.unit=emergency.target

In emergency mode, make the root disk writable before fixing files:

mount -o remount,rw /
vi /etc/fstab        # fix the bad line
reboot

Common interview scenario: "A server doesn't boot after someone edited /etc/fstab." Answer: boot into emergency mode, remount root as read-write, fix or comment out the bad line, and reboot.

All Linux questions Roadmap: Linux

More on Boot Process & Kernel