Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Error "failed to mount /etc/fstab" at startup after attempting to add an HDD to fstab

Writer Andrew Henderson

To start with, I am very new to Linux and Ubuntu in general (only had it a couple months) and so am operating off of what I have learned from actually using Ubuntu in that time.

I am currently running Ubuntu 18.04.1 LTS (Bionic Beaver) on a HP Compaq machine and until recently, everything was working nearly perfectly.

However, I decided to try expanding my storage and options by adding another hard drive, to store my /home folder on. Looking around, I found what looked to be the best way to do it: Partitioning/Home/Moving

Following those instructions, I immediately ran into errors, so I decided to try another way. To make a long story short, I eventually figured out how to get into my /etc/fstab file and tried adding a line on to mount my second hard drive. Unfortunately, I didn't know to make a backup originally, though I did (accidentally) after adding the line on the end. But when adding the line onto the end of the fstab file, as shown in the directions from that link, I encountered some weird warnings in the terminal when I saved the Gedit file. Looking those up, I found that Gedit had a bug that generates those warnings. I don't know how or why, as I am, after all, just a beginner.

Anyway, while messing around, trying to get the one line added on, I must have changed something somewhere, because when I restarted my computer, the /etc/fstab file failed to mount. Here's what it looked like the first time:"Failed to mount /etc/fstab" error And this is what I got after typing in the command for more info: details on "Failed to mount /etc/fstab" error

Thinking I had just accidentally put in an extra number or something, I inserted my Ubuntu installation DVD, booted into "Try Ubuntu" mode, and tried to edit my fstab that way. Although I was able to get into, view, and edit my fstab, I couldn't figure out how to save it, and it kept saying that "/dev/sda1/etc/fstab not a directory". Here's what it looked like: Ubuntu installation disk terminal The /etc/fstab file as shown in this picture is exactly how it was before all this started, with the exception of the last line that I added on. The middle two lines in the picture got clipped by the edge of the terminal (didn't have the window expanded enough), but they are still the original, unedited entries. Everything above that last UUID entry is exactly as original.

Since then I have tried editing the fstab in a couple different ways, trying to get it to where it will at least boot my main drive (the first UUID entry in the last picture). So far, nothing seems to work. Every time I turn on the computer it goes into emergency mode and tells me that /etc/fstab has failed to mount. Is this a problem with the contents of the fstab file, or did something else get messed up? I really can't remember doing anything else at first other than adding the one line on the end. Also, does the number of spaces in an fstab entry really matter? I have tried to read up on fstab, but I've never really seen any mention of spaces being important or not.

Any help on what to do and how to do it, to get my Ubuntu up and running again would be VERY much appreciated. Right now, I'd be happy with just my main drive booting again. Also, clarification on adding a line to the fstab would be useful too. Once again, I am not very good with Linux or computers at all, so only basic computer language would be helpful.

Thanks,

Kaleb

Update: If it is any help to those who commented on this post, these are my options when saving my fstab file in Gedit via the live DVD.

11

1 Answer

After much help from others and little bit or work, my problem has finally been resolved, no thanks to my limited computer skills.

However, the answer was quite a bit different than I thought it would be. The root of the error was that my /etc/fstab file was encoded in UTF-8, which is how gedit saved the file, and it needed to be in ASCII. Although I'm sure more experienced Linux users know a way to convert the one to the other, I couldn't seem to make it work right.
Instead, I took @steeldriver's advice and decided to re-make my fstab file completely.

Fortunately, I had a near-entire back-up of the original file, so the details of writing it were not a problem. The steps I took were: Booted from live Ubuntu DVD> mounted my original root drive> created a new folder and file in the /etc folder using terminal> pasted fstab entries into the new file using sudo nano to edit in the terminal> moved that file into /etc> deleted original fstab file> and renamed the new file as fstab to replace the original. I then rebooted without the live DVD and everything started normally, with no errors. I'm sure there are better ways out there to do this, but this just happened to be what worked in my situation.

Thanks again to everyone who helped me with this problem. It's so good to be able to use my computer normally again.

-Kaleb

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy