How do I change file system in recovery mode to read-write mode?

I have messed up my sudoers file and I want to change the permission on it.

When I login in recovery mode, I cannot run the command chmod as it is read-only option.

I tried mount -o remount,rw / in recovery mode. Didn't work for me:

Err : Ext4-fs remount. Opts errors=remount-ro 

How can I boot into recovery mode and with read-write option?


Solution 1:

I did some web searching on "Recover Mode Read Only" and came across this post on LinuxQuestions.org website.

  1. Shutdown the computer
  2. Boot into Recovery Mode --After BIOS load, hold down Shift key to access the grub menu --Once in grub menu, select the entry ending in "(recovery mode)"
  3. From the next menu selected option to enter Root Session
  4. At the root session, execute command mount -o rw,remount / to remount the filesystem as read-write

Solution 2:

Since the answer is a bit old and did not work for me, I share with you my solution. I mistyped an option in fstab for the / directory (very bad, I know).

In order to mount in recovery mode with read write option the mentioned solutions did not work for me.

I simply chose the kernel with recovery mode option and pressed e to modify the boot parameter from ro to rw.