0

I was looking to set up a new partition on my hard drive and I accidentally made a typo in the fstab configuration file. To be precise, I addded a partition that was not yet formatted in the partition table and rebooted afterwards.

Now, when I start my machine, the system fails to boot properly and enters emergency mode.This is what appears on my screen

You are in emergency mode. After logging in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, "sytemctl default" or "exit" to boot into default mode.

Press Enter for maintenence (or press Control-D to continue):

When I enter my regular user password, the machine won't login to the shell, neither does leaving this field empty work ( as this post would suggest)

I am very new to ubuntu and I have heard that since I didn't set a root password, I assume there is no valid password that can work there

How should I proceed ?

Don't hesitate to ask for other informations

EDIT : I made a fresh install of ubuntu server, and I mounted my old filesystem at /mnt, and for some reason I didn't have to edit fstab afterwards, the system just booted fine. ( see the picture below)

Unbuntu install menu

  • Boot from your install medium in "Try Ubuntu" mode. Then, you can mount your disk and edit its fstab. Read man mount fstab. – waltinator Jun 21 '23 at 19:28
  • does that mean I need to flash a usb stick with the ubuntu server iso ? – chipmunktunic Jun 21 '23 at 19:38
  • Can you boot recovery mode to terminal & sudoedit /etc/fstab ? Otherwise graham's comment is mostly correct. Its old and now gksudo should not be used and it is a graphical edit which as server you may not have. You can use sudoedit which uses default terminal editor often nano. – oldfred Jun 21 '23 at 23:52
  • @oldfred sudoedit uses the $EDITOR and $VISUAL environment variables (man sudoedit) to specify the editor to use. In ~/.bashrc add export VISUAL=$(type -p vim);export EDITOR=$(type -p vim) to use vim. – waltinator Jun 22 '23 at 00:27

1 Answers1

0

You need any linux live CD or image.

Boot up the live cd, then mount the filesystem which contains the /etc/fstab file into maybe the /mnt then just edit the fstab there.

Then the OS should boot up correctly.

If you need to kick the root password, just remove the hash from shadow for root.

Some live CD-s has tools for change root password too.

HBtools
  • 29