LinuxHigh

Solving fstab Errors in Linux: Causes and Step-by-Step Methods

This article explains what causes errors in the fstab file and offers proven ways to fix them—from syntax checking to restoring from backup.

Updated at February 14, 2026
10-15 min
Medium
FixPedia Team
Применимо к:Ubuntu 22.04+CentOS 7+Debian 11+RHEL 8+

What the fstab Error Means

The /etc/fstab (file system table) is a configuration file in Linux that defines how and where disks and partitions should be mounted during system boot. Errors in this file cause the system to be unable to mount the specified file systems. Typical symptoms:

  • During boot, the system hangs on the [ OK ] screen or drops into emergency mode.
  • The mount command outputs messages like:
    mount: /mnt/data: special device /dev/sdb1 does not exist.
    mount: /mnt/data: can't find in /etc/fstab.
    
  • Running sudo mount -a produces syntax or access errors.
  • Expected disks are missing from directories (/mnt, /media).

Key point: fstab is parsed early in the boot process (initramfs), so errors here can completely block system access.

Common Causes

  1. Syntax error in an fstab line — missing space, incorrect delimiter (space or tab), wrong number of fields (must be 6).
  2. Incorrect UUID or device path — the disk was reformatted, replaced, or its UUID changed (e.g., after data recovery).
  3. Specifying a non-existent device — for example, /dev/sdc1 is physically absent or not recognized by the kernel.
  4. Insufficient permissions to mount — the user option is missing, and the user is not root.
  5. Unsupported or incorrectly specified file systemntfs-3g is specified in the fs_vfstype field but the package isn't installed, or mount options are incompatible with the FS.
  6. Mount point conflict — multiple lines attempt to mount different devices into the same directory.
  7. Missing mount directory — the mount point (e.g., /mnt/backup) does not exist.

Method 1: Syntax Check and Testing

The simplest and safest method is to check the file without rebooting.

  1. Check the syntax with the command:
    sudo mount -a
    

    This command attempts to mount all file systems from fstab. On success, the output is empty. On error, you will see the line number and a description of the problem (e.g., wrong fs type, bad option, bad superblock).
  2. If the command doesn't indicate the line, check manually. Open fstab:
    sudo cat -n /etc/fstab
    

    Line numbering (-n) helps quickly locate the problematic line.
  3. Ensure the format is correct. Each line must contain 6 fields, separated by spaces or tabs:
    <device> <mount_point> <fs_type> <options> <dump> <pass>
    

    Example of a correct line:
    UUID=1234-ABCD /mnt/data ntfs-3g defaults,uid=1000 0 2
    
  4. Verify all mount points exist:
    ls -ld /mnt/data /media/usb
    

    If the directory doesn't exist, create it:
    sudo mkdir -p /mnt/data
    

Method 2: Fixing UUID or Device Path

If the error points to a non-existent device, you need to update the information.

  1. Get the current list of devices and their UUIDs:
    sudo blkid
    

    The output will look like:
    /dev/sda1: UUID="a1b2c3d4" TYPE="ext4" PARTUUID="..."
    /dev/sdb1: UUID="e5f6g7h8" TYPE="ntfs"
    
  2. Find the correct disk by size (lsblk) or file system type.
  3. Edit fstab, replacing the old UUID or path with the new one. Use UUID= instead of the /dev/sdX path, as UUIDs are unique and do not change upon reconnection.
    sudo nano /etc/fstab
    

    Change the line, for example:
    # Was (incorrect)
    UUID=old-uuid /mnt/backup ext4 defaults 0 2
    # Now
    UUID=e5f6g7h8 /mnt/backup ntfs-3g defaults 0 0
    
  4. Check again:
    sudo mount -a
    

Method 3: Adding or Correcting Mount Options

Some file systems require specific options. Incorrect options cause the wrong fs type, bad option, bad superblock error.

  • For NTFS (ntfs-3g) — usually requires the uid= option to set the owner:
    UUID=... /mnt/ntfs ntfs-3g defaults,uid=1000,gid=1000,umask=022 0 0
    
  • For FAT32 (vfat) — similar, plus utf8 for Cyrillic characters:
    UUID=... /mnt/usb vfat defaults,uid=1000,gid=1000,utf8 0 0
    
  • For network file systems (NFS, CIFS) — specify credentials= or username=, password=. Check if the server is available.

How to find out which options are supported?
Use man mount and see the "FILESYSTEM-SPECIFIC MOUNT OPTIONS" section. Or temporarily mount manually with different options to find a working configuration:

sudo mount -t ntfs-3g /dev/sdb1 /mnt/test -o uid=1000

Method 4: Restoring from Backup

If you're unsure what you broke, restore the previous working version of /etc/fstab.

  1. If you created a backup before editing (e.g., sudo cp /etc/fstab /etc/fstab.bak), restore it:
    sudo cp /etc/fstab.bak /etc/fstab
    
  2. If there's no backup, check if one exists in the dpkg package (for Debian/Ubuntu):
    sudo dpkg -S /etc/fstab
    

    Usually, fstab is managed by the base-files package. You can try to restore the original:
    sudo apt-get install --reinstall base-files
    

    Warning: this will revert to the default fstab; all your changes will be lost. Use only as a last resort.
  3. Verify the restored file:
    sudo mount -a
    

Method 5: Booting into Recovery Mode (If System Won't Start)

If the system hangs during the fstab mount phase, you need file system access to fix it.

  1. During computer boot (VM or physical machine), open GRUB (usually by holding Shift or Esc).
  2. Select the kernel entry and press e to edit boot parameters.
  3. Find the line starting with linux or linuxefi. At the end, add:
    systemd.unit=rescue.target
    

    or
    init=/bin/bash
    

    The first option boots into a rescue shell with root mounted read-only. The second gives direct bash access, but root will be remounted read-only.
  4. Press Ctrl+X or F10 to boot.
  5. In the rescue shell:
    • If root is mounted read-only, remount it:
      mount -o remount,rw /
      
    • Edit fstab (nano /etc/fstab or vi /etc/fstab).
    • After fixing, run sync and reboot:
      reboot -f
      
  6. For LiveCD/USB: boot from the installation media, mount the root partition, and edit fstab there.

Prevention

To avoid fstab problems in the future:

  1. Always check the syntax after editing with sudo mount -a before rebooting.
  2. Use UUIDs instead of /dev/sdX paths. UUIDs remain constant.
  3. Back up fstab before making changes:
    sudo cp /etc/fstab /etc/fstab.$(date +%Y%m%d)
    
  4. Test mount options manually via mount before adding them to fstab.
  5. Avoid using the noauto option if you want automatic mounting at boot.
  6. For network resources (NFS, SMB), ensure the network is available early in the boot process (may require x-systemd.automount or _netdev).
  7. Watch the order of options — some combinations conflict (e.g., defaults already includes rw,suid,dev,exec,auto,nouser,async).
# Example command to check all mount points from fstab
sudo mount -a && echo "OK" || echo "Error in fstab"

F.A.Q.

Why doesn't the system boot after editing fstab?
How to find the correct disk UUID?
Is it necessary to reboot after fixing fstab?
Can I use a device name instead of UUID in fstab?

Hints

Check the fstab file syntax
Determine the correct UUID or device path
Edit the /etc/fstab file
Test the changes
Reboot the system (optional)
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community