20

Whenever I try to boot my Linux, it goes into emergency mode, saying

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

I have tried it all: checking the logs using the journalctl -xb command, ^d to try again to boot into default mode. I have tried to fsck /dev/sda6 (which is my file system for Linux, /dev/sda7 is the swap). When doing some research about this, I saw some talking about /etc/fstab, but I have not changed anything in it, so I got no idea what I can do...

Can anybody please help? I am new to Linux, and I do not know what information you need to be able to help - Just ask if I need to provide some extra info, please.

Here is what my screen looks like:

enter image description here

The output of sudo blkid and cat ../etc/fstab:

ubuntu@ubuntu:~$ sudo blkid
/dev/sda1: LABEL="ESP" UUID="4EA6-03B9" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="0b902964-aa52-4b36-afda-348bb30a3d82"
/dev/sda3: LABEL="Acer" UUID="C85AA81A5AA806F2" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="45c8bf5c-7fd1-4102-af78-08c7a5c6d5cb"
/dev/sda4: UUID="003CAE413CAE3218" TYPE="ntfs" PARTUUID="45c8223e-e999-43c9-a0fc-7b856a32b5b9"
/dev/sda6: UUID="185abbc0-48d9-4b81-833b-bda921c6e30b" TYPE="ext4" PARTUUID="2cef3951-f4cb-4b3e-b41f-de04db748b60"
/dev/sdb1: LABEL="DATA" UUID="0C08B30A08B2F1B6" TYPE="ntfs" PARTUUID="6c7839ee-01"
/dev/sdc1: LABEL="UBUNTU 16_0" UUID="70BF-D6DB" TYPE="vfat" PARTUUID="3d368215-01"
/dev/loop0: TYPE="squashfs"
/dev/sda2: PARTLABEL="Microsoft reserved partition" PARTUUID="da79d518-04ea-46bb-a01f-58ff38403263"
/dev/sda5: PARTUUID="59dc9a87-37cd-4672-932a-65b7cc7e2f81"
/dev/sda7: UUID="cb5acedb-a691-408f-a35a-2dc6da30e6d1" TYPE="swap" PARTUUID="aa3455c2-5485-4799-be33-6df21430da47"
ubuntu@ubuntu:~$ cat /media/ubuntu/185abbc0-48d9-4b81-833b-bda921c6e30b/etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

#Entry for /dev/sda6 :
UUID=185abbc0-48d9-4b81-833b-bda921c6e30b   /   ext4    errors=remount-ro   0   1
#Entry for /dev/sda3 :
UUID=C85AA81A5AA806F2   /media/Acer ntfs-3g defaults,locale=en_US.UTF-8 00
#Entry for /dev/sdb1 :
UUID=0C08B30A08B2F1B6   /media/DATA ntfs-3g defaults,locale=en_US.UTF-8 00
#Entry for /dev/sda4 :
UUID=4ECAA8ECCAA8D18F   /media/Recovery ntfs-3g defaults,locale=en_US.UTF-8 00
#Entry for /dev/sda7 :
UUID=cb5acedb-a691-408f-a35a-2dc6da30e6d1   none    swap    sw  0   0
/dev/sr0    /media/cdrom0   udf,iso9660 user,noauto 0   0


ubuntu@ubuntu:~$ 

Note that I can access all files and browse through the drive as you can see in this picture(I can even read/write): https://pictr.com/images/2017/09/30/72858a065b0740ab6a2c4b49f87f85f6.jpg

karel
  • 114,770

5 Answers5

22

Your /etc/fstab is wrong.

First, you don't need to mount Acer-specific or recovery partitions, or the CD-ROM.

So, I'd comment out these lines...

sudo -H gedit /etc/fstab

#Entry for /dev/sda3 :
#UUID=C85AA81A5AA806F2   /media/Acer ntfs-3g defaults,locale=en_US.UTF-8 0 0
# note that I commented this out and also changed the "00" to "0 0"

#Entry for /dev/sda4 :
#UUID=4ECAA8ECCAA8D18F   /media/Recovery ntfs-3g defaults,locale=en_US.UTF-8 0 0
# note that I commented this out and also changed the "00" to "0 0"

#/dev/sr0    /media/cdrom0   udf,iso9660 user,noauto 0   0

and change:

#Entry for /dev/sdb1 :
UUID=0C08B30A08B2F1B6   /media/DATA ntfs-3g defaults,locale=en_US.UTF-8 00

to this:

#Entry for /dev/sdb1 :
UUID=0C08B30A08B2F1B6   /media/DATA ntfs-3g defaults,locale=en_US.UTF-8 0 0
# note the change from "00" to "0 0"

that will fix your problem.

However, if you must keep sda4, then the correct line would be...

#Entry for /dev/sda4 :
UUID=003CAE413CAE3218   /media/Recovery ntfs-3g defaults,locale=en_US.UTF-8 0 0
# note the new UUID, and the "0 0" at the end of the line.
heynnema
  • 70,711
  • 2
    OHHH!!! IT WORKED!! You just saved my life! Your time is appreciated! – Ukula Udan Sep 30 '17 at 19:36
  • @heynnema In my case, I get stuck in emergency mode and I do realise that I mounted my recovery and windows drive as well when I shouldn't have. However, I am not able to edit the file using gksudo or vim or emacs. How am I supposed to do it? Please Help. – Quark Dec 23 '17 at 13:25
  • @heynnema I figured it out, nano works, but the problem still continues to exist even after commenting the lines and now on ntfsfix it says that the Linux Swap partition is corrupt. Please Help. – Quark Dec 23 '17 at 13:51
  • @Quark please start a new question. – heynnema Dec 23 '17 at 17:35
  • Awesome! It worked for me too! I was auto-mounting a USB thumb drive that had actually gone bad, causing my Raspberry Pi not to boot. Seeing your answer triggered me to start commenting stuff out in my /etc/fstab file, and when I commented out the USB thumb drive mounting part, boom! It worked! I replaced the thumb drive, updated my fstab file and now I'm good to go again. Thanks! – Gabriel Staples Sep 24 '18 at 15:38
  • @GabrielStaples thanks for the update! Glad it helped to get you running again. Please remember to vote for my answer. Thanks! – heynnema Sep 24 '18 at 15:41
  • I upvoted it several days ago when I first got my system up and running, hence why you didn't see the upvote just now... – Gabriel Staples Sep 24 '18 at 15:47
  • That first line is key: look in /etc/fstab as your starting point. (My problem was due to a poor hgfs mount in a VM) – MartinMlima Jun 03 '21 at 14:28
  • I get Unable to init server: (gedit:962): Gtk-WARNING **... : cannot open display after execute sudo -H gedit /etc/fstab, could you help? – ah bon Nov 28 '21 at 06:54
  • @ahbon That's just noise. Continue to edit as normal. – heynnema Nov 28 '21 at 14:00
11

From my experience, if you have created a new partition or edited existing one, you may get this error. I had the same error some time back. If you happened to be in the the Emergency Mode and see that it cannot load some of your drives. It means that some of your device id have been changed. So, you have to update the id accordingly in /etc/fstab file. Then do the following steps.

  1. Type your root password
  2. cat /etc/fstab
  3. blkid (show the device ids)
  4. Now check which UUID in /etc/fstab does not apper in blkid output
  5. type 'nano /etc/fstab' and Comment out that line (Just put # infront of the line)
  6. type 'reboot' (Now your problem should be fixed and after logging in successfully, you can add the current UUID in /etc/fstab file )

As an example, this is my output of /etc/fstab file, in which I simply commented out the line ( UUID=C3D1-3CB7 /windows vfat utf8,umask=007,gid=46 0 1), because the UUID=C3D1-3CB7 has been changed.

enter image description here

sayem siam
  • 2,291
  • Please do not post screenshot of the terminal. Always copy the text from the terminal and paste into your answer or question. Then format the pasted text as code using the { } icon above the edit window. – user68186 May 09 '19 at 16:18
  • There's a currently accepted answer that the user says worked. Your answer is rather general, and has some problems. You've also posted an identical answer in another thread. Does your answer really answer the question? – vidarlo May 09 '19 at 16:35
  • 2
    I tried different things to solve but didn't work and wasted times. However, the main problem is device id mismatch which I discussed in my answer and I think it should be the correct answer. – sayem siam May 10 '19 at 16:13
  • Thanks! I updated by VirtualBox from 6.0 to 6.1 and got into this problem. One of my auto mount windows-share was listed in fstab but not in blkid. – Kashyap Jul 25 '20 at 23:02
  • 1
    I don't mind people criticizing your answer it's very well detailed and it is the one that I read and immediately solved the problem for me. Thank you! – qualebs Aug 20 '22 at 20:14
2

I received the You are in emergency mode. After logging in... message after performing a Windows Update on my Windows 10 partition (dual boot with Ubuntu 18.04).

Instead of going through the steps above, I restarted into Windows 10 to finish the update. Then I restarted into Windows one more time. And after this I could boot with Ubuntu 18.04 with no problems.

jtorca
  • 143
  • 6
1

This happened to me. I set-up dual boot Windows 10 and ubuntu. The problem with an NTFS drive. I fixed the drive with ntfs-config. The thing was, it edited /etc/fstab with a new entry that entry was wrong.

Then, I solved the problem by:

sudo nano /etc/fstab

comment the ntfs-3g's entry using # at the beginning of the line

Then, save the file by pressing ctrl+x and after that press Y and hit enter. Then, sudo reboot

This solved the issue.

mchid
  • 43,546
  • 8
  • 97
  • 150
Pranu Pranav
  • 349
  • 1
  • 3
  • 11
1

I got stuck in emergency mode on every boot, and for me, I had to ensure that fsck was manually run on all mount points listed in /etc/fstab (running fsck -AR wasn't getting them all automatically.)

For my system, that included weirdly named NVME devices. The command sudo blkid might be helpful in showing all devices and coordinating UUIDs to /dev/xxx names.

For example, here's one of the mount points:

> cat /etc/fstab
(snip)
UUID=c50d5768-8227-4ee7-876a-d36ad99f1ac9 /mount/nvme/ ext4    errors=remount-ro 0       1

Look up the partition by UUID:

> blkid
(snip)
/dev/nvme1n1p2: UUID="c50d5768-8227-4ee7-876a-d36ad99f1ac9" TYPE="ext4" PARTUUID="fe87133b-02"

Run the repair on the partition (must not be mounted - you might need to run this step from a live CD / USB):

> fsck -y /dev/nvme1n1p2
Jeff Ward
  • 945
  • 3
  • 10
  • 17