Linux VPS

Fix "You are in emergency mode" on a Linux VPS

Get a Linux VPS out of systemd emergency mode: read journalctl to find the failed mount, fix a bad /etc/fstab entry or UUID, repair the filesystem with fsck and boot normally.

IntermediateLinux VPS2 min read

When systemd cannot finish booting, usually because a filesystem in /etc/fstab failed to mount, it stops at You are in emergency mode. SSH is not running, so you fix it from the VPS console. The cause is almost always a bad fstab line or a filesystem that needs checking.

Before you start

  • Open the VNC/console from your VPS control panel.
  • Have the root password ready. Emergency mode asks for it.

Find what failed

Log in with the root password and read the boot log:

journalctl -xb | grep -iE "fail|error|timed out" | head -30

Typical lines:

  • Dependency failed for /data or Timed out waiting for device /dev/disk/by-uuid/…: an fstab entry points to a disk that no longer exists or has a new UUID.
  • UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY: the filesystem needs a repair.

Fix /etc/fstab

The root filesystem may be mounted read-only. Remount it writable first:

mount -o remount,rw /

Compare fstab with the real disks:

blkid && cat /etc/fstab

Edit with nano /etc/fstab and correct the UUID, or comment out the broken line with #. For extra data disks, add nofail so that a missing disk never blocks boot again:

UUID=1234-abcd  /data  ext4  defaults,nofail  0  2

Test every entry without rebooting:

systemctl daemon-reload && mount -a

No output means all entries mounted. The full fstab format is explained in mount a new disk with fstab.

Repair the filesystem

If the log asks for fsck, run it on the unmounted partition:

umount /dev/vdb1 && fsck -y /dev/vdb1

For the root filesystem, boot the rescue ISO and run fsck from there, because it cannot be checked while mounted read-write. See fix a read-only file system.

Boot normally

systemctl default

Or simply run reboot. Confirm afterwards with systemctl --failed that no units failed.

Other causes

FAQ

What is the difference between emergency mode and rescue mode?

Rescue mode mounts all local filesystems and starts basic services. Emergency mode mounts only root, usually read-only, because something essential failed.

I don't know the root password. What now?

Boot a rescue ISO, mount the root disk, chroot into it and set a new password with passwd. Then fix fstab from there.

Should I use device names like /dev/vdb1 in fstab?

No. Device names can change between boots. Use UUID= values from blkid.

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.