What To Do When Linux Files Are Read Only

Sometimes you cannot edit and save a single file in Linux.  For example, if you boot into maintenance mode after the /etc/fstab is corrupt, you cannot edit the very file that is causing the problem.  To overcome this problem, you will need to log in as root and issue a command.  You will need to manually edit the /etc/fstab.  To do this in maintenance mode you need to issue this command from the prompt: 
mount -o remount,rw /
After this, you will be able to edit the /etc/fstab file.  Hopefully you will know what is wrong or you have a backup.  Be careful when running scripts that automatically update this file.  If the scripts haven't been tested or cannot handle exceptions, the /etc/fstab can be modified in unusual ways.

Leave a comment

Your email address will not be published. Required fields are marked *