Linux Labs

Inside the system: resources, kernel, processes / Stage 11 of 13

The system did not boot: emergency mode

Not running Starting usually ~20 s
Leave the lesson

Step 4 of 7 · on a machine · 7 min

Repairs from the emergency shell

Here: how to fix the line from the emergency shell and bring the boot to the normal mode.

The order of the repair (in the Wiki):

  1. findmnt -no OPTIONS / — can the root be written to. On this machine it says rw: systemd remounted the root before the cache failed. If the options say ro, run mount -o remount,rw / first.
  2. Fix the line in /etc/fstab according to the journal message, in nano or vim.
  3. systemctl daemon-reload — systemd rereads fstab and recreates the mount units.
  4. mount -a — no errors means the table is in order.
  5. systemctl default — continue the boot to the normal target. systemctl reboot checks the boot from scratch.

The emergency message also offers exit or Control-D, but here they do not leave emergency mode: the shell opens again. systemctl reboot without a fix leads to the same place.

Exercise · do it

Fix the line from the emergency shell

The machine is in emergency mode because of the /srv/cache line (if not, reboot it with sudo reboot). In the emergency shell fix the line according to the journal message, keeping the cache in memory, check the table by mounting it and continue the boot.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Fix the cache line in fstab not done yet
  • Bring the boot to the normal mode not done yet

To look into the failure later, in the normal mode, use the journal of past boots: sudo journalctl --list-boots lists the boots, sudo journalctl -b -1 -p err shows the errors of the previous one.

Step goals

0 of 2
  • Fix the cache line in fstab — not done yet
  • Bring the boot to the normal mode — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Fix the cache line in fstab — not done yet
  • Bring the boot to the normal mode — not done yet
Loading…