Edit /etc/fstab with no acess

Sorry, may be wrong category, but did not see a better option.

I am a noob, really. Many years ago I used to use Fedora 14, and still have it installed as dual boot with Windows. Recently I messed up adding an extra hard-drive to my Fedora install. Now when I try to boot Fedora I get the error message that it is failing to mount the added disk and kicks me out to a command prompt to fix the disk header, and it gives me only read access to files. I do not have the extra HDD anymore, long story, and need to be able to edit /etc/fstab to remove the last line which refers to the mounting of that disk. However the console has only read access so I am unable to edit /etc/fstab.

I have tried to use both RescueDisk, and a lice image of Fedora 32, but so far have not figured out how I can mount my resident Fedora 14 install.

I would be very grateful for any help ! I would include an image of the boot error screen (I took a picture) but I do not see a way to include an image here.

What I would try here is to boot into the Fedora Kernel using init=/bin/bash on the end of the linux line, like so:

After you boot, you will be presented with a root shell which looks like below:

bash-5.0# _

Type the command mount and you should see your Fedora’s root partition mounted as ro,realtime. You should be able to re-mount this with rw permissions by executing the below:

mount -oremount,rw /

Now, the partition should be mounted in rw mode, like below:

From here, you should now be able to vi /etc/fstab and remove/modify anything before rebooting normally.


Hi @njaimo before you use the command vi /etc/fstab, watch some guide for how to use the vi text editor, is a powerful editor, but not exactly a friendly one for novices. :slight_smile:

Quick command reference: VI Editor Cheat Sheet by adzz - Download free from Cheatography - Cheatography.com: Cheat Sheets For Every Occasion

To edit press the i button an than you can start to write before the cursor position.

To exit from the insert mode press esc button

Remember that is best to exit from the insert mode before moving the cursor, some version of vi insert a character if you try to move in that mode

To save the file press :w (colon w)

To exit press :q (colon q)

1 Like

MANY Thanks to both for your replies ! …please be patient with me :slight_smile: as I have a few more questions.

Here is the error I get:

Fedora boots via GRUB, is this where I can do what Striker suggests ? because otherwise Fedora does not let me do anything else.

Thank you too for the advise on vi. Amazingly enough I do remember how to use it from years ago.

Hope the screenshot above helps. Thanks again !

That error indicates a filesystem error and is unable to finish booting.
I don’t know what file systems you have other than what is listed in your screenshot, but you seem to need to run e2fsck on each volume manually so the errors can be fixed.
I would recommend booting to a live USB or DVD then running e2fsck as root on each of your regular system volumes.
The error message above the red [FAILED} tells you the problem and it seems likely the error is on the / volume.
That kind of error can force the read only mount you initially described.

I suspect after doing the e2fsck step on each volume the error will be fixed.

Thank you for the note ! Yes, the error is due to a missing filesystem /dev/nja_virago/nja, and that filesystem and hard-drive are no longer available (long story). the HDD was removed.

The file /etc/fstab in the Fedora installation points to that filesystem, so it tries to mount it when I try to boot Fedora.

I need a way to edit /etc/fstab to remove the line that mounts that file system, so that Fedora will succeed in booting up. The shell I am left with after the error, only gives me read access; I have tried “vi /etc/fstab” but I am unable to save the changes.

I have also tried accessing /etc/fstab after booting a Live CD, but not sure how to mount the filesystem than contains /etc/fstab, so that I can edit it.

Any ideas ?..

You make an excellent point, and one that I was considering making. Personally, I prefer to use nano, because it doesn’t need a cheat sheet (If you need it, you’d better get a hard copy, because if that’s your only box you can’t get at it when you really need it.) having the most important commands at the bottom of the window, including the one you use to get more help. However, the important thing is to have some CLI editor installed that you know that you can use in an emergency, without network access.

1 Like

…fixed… finally figured out how to get from GRUB to do what Striker suggested and worked perfectly. THANK YOU ! Once I figure out what all I need to back up, I will migrate to Fedora 32.

My main concern is how to save all the email and contact info I have in Evolution…

Thank you again for helping me with the missing filesystem and boot issue.

If you haven’t figured it out yet, please open a new topic for that. :+1:

…will do, if I cannot figure it out. Cheers!


Alternatively, just don’t recommend vi to noobs. Using nano /etc/fstab would work too.

Hi @jwakely as you can see i wasn’t recommending vi.
I wrote that as a warning after the previous comment made by @Striker.

Have a good day. :slight_smile:

Thank you ! …I have actually used vi quite a bit in the past, (late 1980’s), and have a basic knowledge…


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.