How to Fix ‘Failed to Mount /etc/fstab’ Error in Ubuntu

Booting up an Ubuntu desktop or server only to be dropped into an emergency shell prompt reading: “You are in emergency mode. After logging in, type ‘journalctl -xb’ to view system logs… Failed to mount /etc/fstab” or “Timed out waiting for device /dev/disk/by-uuid/…” halts system initialization. In Linux system architecture, /etc/fstab (file systems table) is the configuration file that dictates which disk partitions, swap spaces, network NFS shares, or external drives the systemd init system must mount during boot. If an entry in /etc/fstab references an invalid Universally Unique Identifier (UUID), a non-existent device path, an unrecognized filesystem driver, or a corrupted partition, systemd’s local-fs.target triggers a critical failure and aborts normal boot to prevent filesystem damage. This guide outlines how to troubleshoot fstab errors and restore normal booting in Ubuntu.

What Causes ‘Failed to Mount /etc/fstab’ in Ubuntu?

Systemd drops Ubuntu into maintenance mode when fstab conditions fail:

  • UUID Mismatch Following Re-partitioning: Reformatting a drive or resizing partitions generates a new UUID, leaving the old UUID hardcoded in /etc/fstab.
  • Disconnected Secondary or External Drives: Having an external USB hard drive or secondary internal SATA drive configured in fstab without the nofail mount option.
  • Filesystem Corruption on Boot Partitions: Dirty unmounts, power cuts, or bad sectors causing fsck to fail consistency checks during initialization.
  • Syntax Errors or Malformed Delimiters: Typographical errors in fstab column arguments (missing mount points, mistyped options like defaults, or missing numeric dump/pass flags).
  • Unreachable Network Filesystems (NFS/Samba): Network shares configured without the _netdev parameter attempting to mount before networking services are active.

Method 1: Identify the Failing Mount via journalctl

Systemd records the exact line and device triggering the boot barrier in its boot journal.

  1. At the emergency mode prompt, press Enter to access the root maintenance shell (enter your root password if prompted).
  2. Execute journalctl filtered for critical mount failures:
    journalctl -xb | grep -i "mount"
  3. Look for red text indicating:
    Timed out waiting for device dev-disk-by-uuid-1234abcd.device.
    Dependency failed for /mnt/data.
    Dependency failed for Local File Systems.
  4. Note the failing mount point (e.g., /mnt/data) or the missing UUID.

Method 2: Remount the Root Filesystem as Read-Write

Emergency mode mounts the root filesystem as read-only by default, preventing file edits.

  1. In the emergency shell, remount the root filesystem with write privileges:
    mount -o remount,rw /
  2. Verify that write access is active by creating and checking a temporary timestamp:
    touch /tmp/test && rm /tmp/test

Method 3: Check Actual Partition UUIDs with blkid

Comparing your physical drive UUIDs against the entries in fstab immediately reveals discrepancies.

  1. List all active disk block devices and their current UUIDs:
    blkid
  2. Open /etc/fstab in the nano text editor:
    nano /etc/fstab
  3. Compare the UUID strings in /etc/fstab with the output of blkid.
  4. If an entry does not match the actual disk UUID, update the fstab entry with the correct string.
  5. If a secondary drive, backup disk, or network share is missing or offline, comment out the line by adding a # at the start of the line.
  6. Alternatively, append nofail to the mount options for non-essential drives:
    UUID=1234-ABCD  /mnt/backup  ext4  defaults,nofail  0  2
    (The nofail option instructs systemd to continue booting normally even if the drive is disconnected).
  7. Press Ctrl + O and Enter to save, then Ctrl + X to exit nano.

Method 4: Test fstab Configuration and Reboot

Verifying mounts before rebooting ensures no syntax errors remain.

  1. Execute a test mount of all entries in fstab:
    mount -a
  2. If the command returns completely silent with no output, your fstab syntax and UUIDs are 100% valid. If an error appears, re-check the specified line.
  3. Reboot the system into normal mode:
    systemctl reboot

Ubuntu fstab Troubleshooting Matrix

Boot Symptom Underlying Fault Primary Fix
Timed out waiting for device UUID mismatch or drive disconnected Verify with blkid; add nofail to options
Read-only filesystem error in nano Emergency mode read-only lock Execute mount -o remount,rw /
fsck returned with exit code 4 Filesystem corruption on partition Run manual repair: fsck -y /dev/sdXn
Network share fails on boot NFS mounted before network active Add _netdev to mount options in fstab

Correcting UUID mismatches and adding the nofail flag permanently fixes fstab mount failures and restores normal booting in Ubuntu.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.