Skip to content
VLASIFY™
TroubleshootingHPC, GPU & Linux

Linux boot failure after a power outage: emergency mode, fsck and recovery

Updated · Scientifically reviewed by Priyank Srivastava, PhD on

Short answer

After an abrupt power loss, Linux usually fails to boot because a file system needs checking, a mount listed in /etc/fstab (often a network or data disk) is unavailable, or a RAID array is degraded. Read the console message, boot into emergency or rescue mode, check the root and data file systems with the correct tool for their type on unmounted devices, fix or temporarily disable failing fstab entries, and check RAID status. Take an image of the disk first if the data is irreplaceable and not backed up.

Who this is for

Researchers and lab administrators responsible for Linux workstations, servers or small clusters without a dedicated IT team.

Software

systemd ≥ 239e2fsprogs / xfsprogs distribution default

Symptoms

  • “You are in emergency mode. After logging in, type journalctl -xb to view system logs” after a long wait at boot.
  • A (initramfs) BusyBox prompt on Ubuntu or Debian, often with a message that the root file system needs a manual check.
  • “A start job is running for dev-disk-by-uuid…” counting down for 90 seconds.
  • Kernel messages about file system corruption, or a RAID array reported as degraded or inactive.
  • The system boots but a data directory is empty because its disk did not mount.

Diagnosis

From the emergency shell (enter the root password) or a live USB system:

journalctl -xb -p err          # errors from this boot
systemctl --failed             # failed units, often *.mount
lsblk -f                       # devices, file system types, UUIDs
cat /etc/fstab
cat /proc/mdstat               # software RAID status

Compare the UUIDs in /etc/fstab with lsblk -f. A failed .mount unit points to the exact entry.

Fixes

1. Root file system needs a check (initramfs prompt). The message names the device. For ext4:

fsck -y /dev/sda2
exit

Replace /dev/sda2 with the device named in the message.

2. A data file system is damaged. Unmount it, then use the tool for its type:

umount /data
e2fsck -f /dev/sdb1     # ext4
xfs_repair /dev/sdb1    # XFS; if it refuses because of a dirty log, mount and unmount once to replay it

Use xfs_repair -L (which zeroes the log and can lose recent changes) only when mounting fails and you accept that risk.

3. A missing disk or network share blocks boot. Edit /etc/fstab (remount root read-write first with mount -o remount,rw /) and add nofail to non-essential entries, for example:

UUID=3f6c2b1e-0000-4000-8000-000000000000  /data  ext4  defaults,nofail  0  2

For NFS shares add _netdev,nofail. Then systemctl daemon-reload and reboot.

4. Software RAID is degraded or inactive.

mdadm --detail /dev/md0
mdadm --assemble --scan

Replace failed disks and let the array rebuild before relying on it. Check disk health with smartctl -a /dev/sda (package smartmontools).

5. Kernel or driver mismatch after an interrupted update. Choose the previous kernel under “Advanced options” in the GRUB menu, then finish the update with sudo dpkg --configure -a (Debian/Ubuntu) and reinstall the GPU driver; see NVIDIA driver on Ubuntu.

When to get help

  • The disk reports SMART errors or makes unusual noises: stop and image it with ddrescue before any repair.
  • Repairs report extensive damage, or the data is irreplaceable and not backed up.
  • Several cluster nodes or the shared storage server failed together.

Assumptions and limitations

  • Commands assume systemd-based distributions and ext4, XFS or mdadm RAID. Btrfs, ZFS and hardware RAID controllers have their own tools.
  • Device names in examples are illustrative. Always confirm the device with lsblk -f before running a repair.
  • File system repair can lose data. Backups are the only reliable protection.

Frequently asked questions

Is it safe to run fsck?+

On an unmounted file system with the correct tool for its type, it is the standard repair. Never run a repair on a mounted read-write file system. If the data is valuable and not backed up, image the disk first, because repairs can move damaged files into lost+found.

Why does the server wait 90 seconds and then enter emergency mode?+

systemd is waiting for a device listed in /etc/fstab that never appears, such as a disconnected data disk, a changed UUID or a network share. Adding nofail (and for network shares, _netdev) to non-essential entries lets the system boot without them.

The GPU driver stopped working after the outage. Is that related?+

Sometimes the outage interrupted an automatic update, leaving a kernel without matching driver modules. Boot the previous kernel from the boot menu, then reinstall the driver for the current kernel.

How do I prevent this?+

Use a UPS with automatic clean shutdown (for example NUT or apcupsd), keep backups, mark non-essential mounts nofail, and monitor disk and RAID health so problems are found before an outage exposes them.

References

  1. systemd.mount(5): nofail, x-systemd.device-timeout · freedesktop.org
  2. e2fsck(8) manual page · Linux man-pages
  3. xfs_repair(8) manual page · Linux man-pages
  4. mdadm(8) manual page · Linux man-pages

Still stuck?

Send us the error output and your job script. A computational scientist will diagnose it, usually within a day.

Services listed on this page are available today. Products marked “early access” or “in development” on our platform page are not yet generally available.

Spotted an error or an outdated command? Tell us. We correct verified issues promptly.

Related guides

How Vlasify can help

Get a Quote