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


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?


Try to edit with sudo:

sudo nano /etc/fstab


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

sudo mount -o remount, rw /  


Edit it using sudo $EDITOR /etc/fstab


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
Next Post »