Sunday, August 21, 2016

How to fix a broken fstab in Ubuntu

I was messing around with my /etc/fstab settings which connect my Ubuntu desktop to my NAS server via Samba and I screwed it up. When I restarted my desktop, Ubuntu would just hang asking for a password and yet I could not provide the password and get to the login screen. Boot failure!

So I found this little nugget of wisdom on "How to fix a broken fstab in Ubuntu" which got my desktop going again:

Fix Broken /etc/fstab

    • Boot into the Ubuntu Live CD
    • Open terminal
    • Run the following commands to mount the partition with the root / directory and edit /etc/fstab:

sudo mkdir /media/mount
sudo mount /dev/sd[a..z][1..n] /media/mount
sudo vi /media/mount/etc/fstab

    • Make your changes, save, and then reboot without the Live CD

In my case, I just placed a comment hash # on the fstab line that defined the Samba share so I could get into my desktop again and fix the problem.

No comments:

Post a Comment