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
mountcommand 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 -aproduces 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
- Syntax error in an fstab line — missing space, incorrect delimiter (space or tab), wrong number of fields (must be 6).
- Incorrect UUID or device path — the disk was reformatted, replaced, or its UUID changed (e.g., after data recovery).
- Specifying a non-existent device — for example,
/dev/sdc1is physically absent or not recognized by the kernel. - Insufficient permissions to mount — the
useroption is missing, and the user is not root. - Unsupported or incorrectly specified file system —
ntfs-3gis specified in thefs_vfstypefield but the package isn't installed, or mount options are incompatible with the FS. - Mount point conflict — multiple lines attempt to mount different devices into the same directory.
- 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.
- 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). - 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. - 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 - 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.
- 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" - Find the correct disk by size (
lsblk) or file system type. - Edit fstab, replacing the old UUID or path with the new one. Use UUID= instead of the
/dev/sdXpath, 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 - 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
utf8for Cyrillic characters:UUID=... /mnt/usb vfat defaults,uid=1000,gid=1000,utf8 0 0 - For network file systems (NFS, CIFS) — specify
credentials=orusername=,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.
- 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 - If there's no backup, check if one exists in the
dpkgpackage (for Debian/Ubuntu):sudo dpkg -S /etc/fstab
Usually, fstab is managed by thebase-filespackage. 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. - 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.
- During computer boot (VM or physical machine), open GRUB (usually by holding Shift or Esc).
- Select the kernel entry and press
eto edit boot parameters. - Find the line starting with
linuxorlinuxefi. At the end, add:systemd.unit=rescue.target
orinit=/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. - Press Ctrl+X or F10 to boot.
- In the rescue shell:
- If root is mounted read-only, remount it:
mount -o remount,rw / - Edit fstab (
nano /etc/fstaborvi /etc/fstab). - After fixing, run
syncand reboot:reboot -f
- If root is mounted read-only, remount it:
- For LiveCD/USB: boot from the installation media, mount the root partition, and edit fstab there.
Prevention
To avoid fstab problems in the future:
- Always check the syntax after editing with
sudo mount -abefore rebooting. - Use UUIDs instead of
/dev/sdXpaths. UUIDs remain constant. - Back up fstab before making changes:
sudo cp /etc/fstab /etc/fstab.$(date +%Y%m%d) - Test mount options manually via
mountbefore adding them to fstab. - Avoid using the
noautooption if you want automatic mounting at boot. - For network resources (NFS, SMB), ensure the network is available early in the boot process (may require
x-systemd.automountor_netdev). - Watch the order of options — some combinations conflict (e.g.,
defaultsalready includesrw,suid,dev,exec,auto,nouser,async).
# Example command to check all mount points from fstab
sudo mount -a && echo "OK" || echo "Error in fstab"