Ubuntu: Cannot log in to Ubuntu after changing /etc/fstab



Question:

I was recently trying to change my /home directory to a new hard drive using these instructions.

I got to the step where I have to change the fstab file and I think what I did was I set the location to /home instead of /media/home. Well now when I try to log into my computer, it brings me back to the log in page, but it doesn't say that my password was wrong, so I know that's not the problem.

I've been trying to do the Ctrl+Alt+F2 thing to edit the fstab file from the command line, but its a read-only file. I also tried changing the permissions of the file with chmod, but that doesn't work either.

What else can I do to solve this?


Solution:1

Try to edit with sudo:

sudo nano /etc/fstab


Solution:2

You will be able to change fstab file after remounting root filesystem in read-write mode, using this command:

sudo mount -o remount, rw /  


Solution:3

Edit it using sudo $EDITOR /etc/fstab


Solution:4

Try: sudo vi /etc/fstab and after editing press Esc to get vi go to command mode and then :wq! to save and overwrite


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »