Ubuntu – I accidentally made the file system read only. How to change it back

filesystemmountpermissions

I accidentally locked my Ubuntu System. Now everything is read only. The closest i can remember which might have done this is, I was trying to change the authority of a fstab symllink with chown -h myusername /db. Now everything is read only, file system, mounted volume, all except my home folder. Even when i open the file browser as admin i.e. sudo nautilus i can't create and change any file or folder.

What might have caused this? Help me turn things back to normal.

Best Answer

It sounds like you've accidentally changed the permissions of /etc/fstab. You should be able to use sudo because /var/run/sudo is mounted on the /var/run filesystem (or /run for Oneiric and up).

First, make the root partition writable again:

sudo mount -o remount,rw /

Next, restore the permissions:

sudo chown root: /etc/fstab

After that, future boots should not make everything read-only.

Related Question