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.
More on Boot Process & Kernel
Walk through the Linux boot process from power-on to login prompt.BeginnerWhat is the difference between BIOS and UEFI booting?IntermediateWhat does GRUB2 do and where is its configuration?BeginnerWhat is the initramfs and why is it needed?AdvancedHow do you view and change kernel command-line parameters?IntermediateWhat is systemd and why did it replace SysV init?Beginner