3

To make a long story short, and to focus the question, I basically need to get root access to my own laptop running Linux Mint to be able to save my changes to the /etc/fstab file.

More details:

I'm writing this on my phone because I think I broke my computer.

I dual boot Windows 10 and Linux Mint Cinnamon and I wanted my Linux partition to be shared between both operating systems. So I edited /etc/fstab to allow this, but I should have left the file path alone because now I broke it. Originally the file path was just / but I changed it to /home/will/shared thinking that this works like subst in Windows (it does not).

When I restarted in Linux it didn't show the desktop but instead showed a primitive looking terminal. There was an error message but it went away so fast I couldn't get a picture in time. Said something about GRUB, I think that's the bootloader so it might be relevant

I thought if I change /etc/fstab back to how I had it, everything would be fixed, but when I try to save it says the file is read only.

sudo editor /etc/fstab won't let me save it, so how do I revert my changes?

Here is a screenshot of the /etc/fstab itself.

Screenshot of the /etc/fstab content.

Here is a screenshot of the terminal I see when I boot now. The text reads:

Linux Mint 20.2 Uma will-HP-Laptop-14-dk1xxx tty1
will-HP-Laptop-14-dk1xxx login:

Screenshot of the terminal I see when I boot now.

0

1 Answer 1

0

See if you can boot the machine into single user mode and edit the /etc/fstab without issue.

If you can boot the system into single user mode, that is effectively the same as logging in as root so you can just then edit your /etc/fstab and undo the mistake. Then just reboot and all should one fine.

Here are more details on how to do that as explained in this answer to a similar issue on the Unix & Linux Stack Exchange site:

It seems that I’ve found a solution:

  • At the GRUB prompt, hit A to append options.
  • Add init=/bin/bash to the end of the kernel command line and press Enter.

The system will boot to a prompt like bash-3.2# enter the following commands at the prompt

mount -o remount,rw /

Then edit the fstab:

vim /etc/fstab

Edit the fstab file commenting the errors by adding a # at the begining of each problematic line, save the file and reboot by pressing Ctrl+Alt+Del.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .