Solution to "/etc/fstab cannot open file for writing" error - unable to modify or save.

There is a disk partition mounted to two directories. I directly executed `umount -a` to unmount both mounts, but the configuration in `/etc/fstab` was not cleared.

After opening /etc/fstab with vi, I restored it to its original state, but an error message appeared when saving.

-- INSERT -- w10: Warning: Changing a readonly file

When saving after making changes, a prompt appears.

'fstab' E212: Can't open file for writing

:w! didn't work either.

It seems it was mounted as read-only. So, execution...

root# mount -o remount,rw /

Try using `vim /etc/fstab` again, and you should be able to save it.

This siteOriginal articleAll follow "Attribution-NonCommercial-ShareAlike 4.0 License (CC BY-NC-SA 4.0)Please retain the following annotations when sharing or adapting:

Original author:Jake Tao,source:Solution to the error "/etc/fstab cannot open file for writing, unable to modify or save".

207
0 0 207

Post a reply

Log inYou can only comment after that.
Share this page
Back to top