Commit f3e364d49d

f3e364d49d4ae6254956566e2baab92cb853641f

parent: 10ce83b42d

Unsigned

cmc <hello@cleberg.net> · 2024-02-14 02:37 UTC

add emergency mode post

Layout: unified · split

content/blog/2024-02-13-ubuntu-emergency-mode.md added +71
@@ -0,0 +1,71 @@
1+++
2date = 2024-02-13
3title = "Stuck in Ubuntu's Emergency Mode? Try Fixing the Fstab File"
4description = "Learn how to fix a missing disk issue that can lock you in Ubuntu's emergency mode."
5+++
6
7### The Problem
8
9I recently [migrated my hard drives to a ZFS pool](/blog/zfs/) and found myself
10stuck in Ubuntu's emergency mode after the first reboot I performed after
11creating the ZFS pool.
12
13My server was stuck in the boot process and showed the following error on the
14screen:
15
16```txt
17You are in emergency mode.
18After logging in, type "journalctl -xb" to view system logs,
19"systemctl reboot" to reboot, "systemctl default"
20or ^D to try again to boot into default mode".
21```
22
23After rebooting the server and watching the logs scroll on a monitor, I noticed
24the root cause was related to a very long search for certain drives. I kept
25seeing errors like this:
26
27```txt
28[ TIME ] Timed out waiting of device dev-disk-by/[disk-uuid]
29```
30
31I realized that I had not removed the `/etc/fstab` references that asked Ubuntu
32to mount two disks on boot, but I had recently changed those disks to be part of
33my ZFS pool instead. Therefore, Ubuntu was trying to identify and mount a disk
34that was not available.
35
36Now that we have an idea of the issue, let's move to solution.
37
38### The Solution
39
40In order to fix the issue, I waited until I was allowed to type the root user's
41password, and then I executed the following command:
42
43```sh
44nano /etc/fstab
45```
46
47Within the `fstab` file, I needed to comment/remove the following lines at the
48bottom of the file. You can comment-out a line by prepending a `#` symbol at the
49beginning of the line. You can also delete the line entirely.
50
51```conf
52# What it looked like when running into the issue:
53UUID=B64E53824E5339F7 /mnt/white-01 ntfs-3g uid=1000,gid=1000 0 0
54UUID=E69867E59867B32B /mnt/white-02 ntfs-3g uid=1000,gid=1000 0 0
55
56# What I changed it to, in order to fix the issue:
57# UUID=B64E53824E5339F7 /mnt/white-01 ntfs-3g uid=1000,gid=1000 0 0
58# UUID=E69867E59867B32B /mnt/white-02 ntfs-3g uid=1000,gid=1000 0 0
59```
60
61Once removing the lines above from the `/etc/fstab` file, save and exit the file
62by hitting the `Ctrl` + `x` key combo.
63
64You can now hit `Ctrl` + `D` to continue, or reboot:
65
66```sh
67systemctl reboot
68```
69
70Once rebooted, I was able to watch the machine boot properly and launch to the
71TTY login screen without errors!