0% found this document useful (0 votes)
38 views

How To Fix "Failed To Mount Etcfstab" Error in Linux

The document discusses how to fix the "failed to mount /etc/fstab" boot error in Linux. It explains that the /etc/fstab file contains information about filesystems that can be mounted automatically at boot time. The error can occur if there are issues with the specifications in this file. The document provides steps to check the systemd journal for errors, inspect the /etc/fstab file for errors like invalid characters, and offers tips to avoid this issue like always backing up configuration files before editing.

Uploaded by

John Doe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

How To Fix "Failed To Mount Etcfstab" Error in Linux

The document discusses how to fix the "failed to mount /etc/fstab" boot error in Linux. It explains that the /etc/fstab file contains information about filesystems that can be mounted automatically at boot time. The error can occur if there are issues with the specifications in this file. The document provides steps to check the systemd journal for errors, inspect the /etc/fstab file for errors like invalid characters, and offers tips to avoid this issue like always backing up configuration files before editing.

Uploaded by

John Doe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Learn Linux in One Week and Go From Zero to

Hero - Get This Book

! Menu

! Menu $

How to Fix “failed to


mount /etc/fstab” Error
in Linux

Aaron Kili Last Updated: June 27, 2017


Linux Commands 10 Comments

PV Panel Mounting Structure


ART SIGN offer Japan
standarded aluminum and
carbon steel solar panel
ground mounting.

In this article, i will explain how to solve


“failed to mount /etc/fstab” boot error
in Linux. The file in question contains
descriptive information concerning the
filesystems the system can mount
automatically at boot time.

This information is static and is read by


other programs on the system such as
mount, umount, dump and fsck. It has
six important filesystem mount
specification fields: the first field
describes the block special device or
remote filesystem to be mounted, the
second field defines the mount point for
the filesystem and the third specifies the
filesystem type.

The fourth field defines the mount


options associated with the filesystem,
and the fifth field is read by dump tool.
The last field is used by fsck tool to
establish the order of filesystem-checks.

Suggested Read: How to


Determine and Fix Boot Issues in
Linux

After editing the /etc/fstab to create an


automount and rebooting my system; it
booted into emergency mode showing
the error message below.

Linux Emergency Mode

I logged in as root from the interface


above, and typed the following
command to look through the systemd
journal; then I saw the errors shown in
the screen shot (indicated using red).

PV Panel Mounting Structure


ART SIGN offer Japan
standarded aluminum and
carbon steel solar panel
ground mounting.

As you can see, the main error (failure


of etc-fstab.mount unit) lead to several
other errors (systemd unit dependency
issues) such as failure of local-fs.target,
rhel-autorelabel-mark.service etc.

# journalctl -xb

Boot Error Messages

Causes of “failed to mount


/etc/fstab” Error in Linux

The error above may result from any of


the issues below, in the /etc/fstab file:

missing /etc/fstab file


wrong specification of filesystem
mount options,
failing mount points or
unrecognized characters in the
file.

To solve it, you can use the original file if


you created a backup, otherwise
comment out any changes you made
using the “#” character (and also ensure
that all the uncommented lines are
filesystem mount lines).

So I opened the /etc/fstab using vi/m


text editor to check for any errors.

# vi /etc/fstab

Linux /etc/fstab File

I realized I had typed an “r” letter at


the beginning of the file as shown in the
screen shot above – this was
recognized by the system as a special
device which did not actually exist in
the filesystem, thus resulting to the
sequential errors shown above.

This took me several hours before


noticing and fixing it. So I had to remove
the letter, commented out the first line in
the file, closed and saved it. After
running a reboot, the system booted
well again.

How to Avoid Such Issues


in the Future

To avoid encountering such issues on


your system, take note of the following:

Always create a backup of your config


files before editing them. In case of any
errors in your configs, you can revert to
the default/working file.

For instance:

# cp /etc/fstab /etc/fstab.orig

Secondly, check config files for any


errors before saving them, certain
applications offer utilities to check
syntax of config files before running the
application. Use these utilities where
possible.

However, if you happen to get any


system errors messages:

First look through the systemd journal


using the journalctl utility to determine
what exactly caused them:

# journal -xb

If you can’t resolve the errors in one


way or the other, run to any of the
millions of Linux forums on the web and
post the issue there.

Do check out some useful related


articles.

A Basic Guide to Linux Boot


Process
4 Best Linux Boot Loaders
Manage Log Messages Under
Systemd Using Journalctl
[Comprehensive Guide]
Managing System Startup
Process and Services (SysVinit,
Systemd and Upstart)
Process Management in RHEL 7:
Boot, Shutdown, and Everything
in Between

That’s it for now. In this article, I


explained how to solve the “failed to
mount /etc/fstab” boot error in Linux.
Once again, to avoid such issues (or if
you encounter any boot issues),
remember to follow the guidelines
offered above. Lastly, you can add your
thoughts to this guide via the feedback
form below.

% Linux FAQ's

& How to Install Speed Up Nginx


LEMP (Linux, Performance with
Nginx, MariaDB, Ngx_Pagespeed on
PHP-FPM) on CentOS 7 "
Debian 9 Stretch

If you liked this article, then do


subscribe to email alerts for Linux
tutorials. If you have any questions
or doubts? do ask for help in the
comments section.

If You Appreciate
What We Do Here
On TecMint, You
Should Consider:

TecMint is the fastest


growing and most trusted
community site for any kind
of Linux Articles, Guides
and Books on the web.
Millions of people visit
TecMint! to search or
browse the thousands of
published articles available
FREELY to all.

If you like what you are


reading, please consider
buying us a coffee ( or 2 )
as a token of appreciation.

We are thankful for your


never ending support.

Related Posts

Check Linux Configuration Files

30 Ways to Validate
Configuration Files or Scripts in
Linux

How to Create File in Linux

8 Practical Examples of Linux


“Touch” Command

MySQL Backup and Restore


Commands for Database
Administration

How to Run a Linux Command


Without Saving It in History

How to Run a Command


Multiple Times in Linux

Disable Su Access to User

How to Disable ‘su’ Access for


Sudo Users

10 thoughts on “How
to Fix “failed to mount
/etc/fstab” Error in
Linux”

chaitanya
October 23, 2020 at 11:12 am

Hi, I have tried with the above


one but it did not work. I cant
able to write in /etc/fstab and
while opening the /etc/sudoers
file it is showing as permission
denied.

Can you please help me to


resolve the issue?

Reply

john
August 31, 2020 at 6:25 pm

Hi,

I am currently experiencing the


same issue with an incorrect
statement in my fstab file. when
I use vim to edit /etc/fstab and
correct the problem, I can’t save
the file because it says it is a
read-only file. how do I bypass
this in order to save the
correction made to the fstab
file?

Thanks

Reply

Aaron Kili
September 1, 2020 at 12:11 pm

@John

Try to edit it with sudo or root


privileges:

$ sudo vim /etc/fstab


OR
# vim /etc/fstab

Reply

Jack H
September 1, 2020 at 12:43 pm

@john, Simply shift-right-click


a folder previous (like the etc
folder) and choose to open as
administrator (or whatever the
verbiage is).

Reply

Brian Brian
September 14, 2017 at 12:07 pm

Your tutorial makes sense,


however I as hoping to see you
address the issue, what if your
system says “cannot cd into
/etc/fstab no such directory or
file“?

It is an Ubuntu 14.04 with an


ubuntu3.13-107 generic kernel.

We were having frequent


power brownouts.

Reply

Aaron Kili
September 14, 2017 at 1:39 pm

@Brian

This was a practical problem


that i faced before, that is why
i came up with the solution.
Most times you’ll encounter
the failed to mount /etc/fstab
or Cannot read /etc/fstab: file
not found; these are the two
most common errors with
/etc/fstab file.

If the file is missing(say


accidentally deleted), then you
need to recover it, in case you
have a backup you can restore
the it or else manually add all
the necessary auto-mount
entries.

Reply

PV Panel Mounting Structure


ART SIGN offer Japan standarded aluminum and carbon steel
solar panel ground mounting. #
ART SIGN
Michael Get Quote

You might also like