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
nofailmount option. - Filesystem Corruption on Boot Partitions: Dirty unmounts, power cuts, or bad sectors causing
fsckto 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
_netdevparameter 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.
- At the emergency mode prompt, press Enter to access the root maintenance shell (enter your root password if prompted).
- Execute
journalctlfiltered for critical mount failures:journalctl -xb | grep -i "mount" - 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. - 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.
- In the emergency shell, remount the root filesystem with write privileges:
mount -o remount,rw / - 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.
- List all active disk block devices and their current UUIDs:
blkid - Open
/etc/fstabin the nano text editor:nano /etc/fstab - Compare the UUID strings in
/etc/fstabwith the output ofblkid. - If an entry does not match the actual disk UUID, update the fstab entry with the correct string.
- 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. - Alternatively, append
nofailto the mount options for non-essential drives:
(TheUUID=1234-ABCD /mnt/backup ext4 defaults,nofail 0 2nofailoption instructs systemd to continue booting normally even if the drive is disconnected). - 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.
- Execute a test mount of all entries in fstab:
mount -a - 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.
- 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.