本文最后更新于:2024年11月29日 上午

Ubuntu 系统加载遇到错误无法进入操作系统,魂儿都吓没了,本文记录解决过程。

问题复现

我的 Ubuntu 22 在一次正常关机之后开机报错:

1
2
3
4
[FAILED] Failed to start file system check on /dev/disk/by-uuid/6a982e39-9594-43e5-9328-d95a092945f8 
[DEPEND] Dependency failed for /home
[DEPEND] Dependency failed for Local File Systems
You are in emergency mode.

太吓人了

问题原因

可能由于磁盘老化,系统磁盘有坏道之类的问题,或系统在磁盘读写时强行关机导致磁盘加载错误。

解决方案

1
lsblk -f

可以查看当前 uuid 的磁盘还在不在,我在 emergency mode 中运行命令的结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
NAME        FSTYPE   FSVER LABEL     UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0 squashfs 4.0 0 100% /snap/bare/5
loop1 squashfs 4.0 0 100% /snap/core18/2846
loop2 squashfs 4.0 0 100% /snap/core20/2379
loop3 squashfs 4.0 0 100% /snap/core20/2434
loop4 squashfs 4.0 0 100% /snap/core22/1663
loop5 squashfs 4.0 0 100% /snap/core24/490
loop6 squashfs 4.0 0 100% /snap/core22/1621
loop7 squashfs 4.0 0 100% /snap/core24/609
loop8 squashfs 4.0 0 100% /snap/firefox/5273
loop9 squashfs 4.0 0 100% /snap/firefox/5361
loop10 squashfs 4.0 0 100% /snap/gnome-3-28-1804/198
loop11 squashfs 4.0 0 100% /snap/gnome-42-2204/141
loop12 squashfs 4.0 0 100% /snap/gnome-42-2204/176
loop13 squashfs 4.0 0 100% /snap/gnome-46-2404/48
loop14 squashfs 4.0 0 100% /snap/gtk-common-themes/1535
loop15 squashfs 4.0 0 100% /snap/irfanview/53
loop16 squashfs 4.0 0 100% /snap/mesa-2404/143
loop17 squashfs 4.0 0 100% /snap/mysql-workbench-community/13
loop18 squashfs 4.0 0 100% /snap/mysql-workbench-community/15
loop19 squashfs 4.0 0 100% /snap/notepad-plus-plus/411
loop20 squashfs 4.0 0 100% /snap/snap-store/1113
loop21 squashfs 4.0 0 100% /snap/notepad-plus-plus/410
loop22 squashfs 4.0 0 100% /snap/snap-store/1216
loop23 squashfs 4.0 0 100% /snap/snapd/21759
loop24 squashfs 4.0 0 100% /snap/snapd/23258
loop25 squashfs 4.0 0 100% /snap/snapd-desktop-integration/247
loop26 squashfs 4.0 0 100% /snap/snapd-desktop-integration/253
loop27 squashfs 4.0 0 100% /snap/wine-platform-6-stable/19
loop28 squashfs 4.0 0 100% /snap/wine-platform-9-devel-core22/30
loop29 squashfs 4.0 0 100% /snap/wine-platform-9-devel-core22/31
loop31 squashfs 4.0 0 100% /snap/wine-platform-runtime/393
loop32 squashfs 4.0 0 100% /snap/wine-platform-runtime-core22/91
loop33 squashfs 4.0 0 100% /snap/wine-platform-runtime-core22/92
loop34 squashfs 4.0 0 100% /run/wine
loop35 0 100% /snap/wine-platform-runtime/394
nvme0n1
├─nvme0n1p1 vfat FAT32 ESP 5CC4-0CC4 944.5M 5% /boot/efi
├─nvme0n1p2 ntfs OS F2ACC4C2ACC48299
├─nvme0n1p3 ntfs software 5C4A914E4A9125B4
├─nvme0n1p4 ntfs workspace 14FE6913FE68EF04
├─nvme0n1p5 vfat FAT32 F4AE-36B7
├─nvme0n1p6 swap 1 a1b4abe7-bc5d-4e8b-80d1-85be1d4f4d3c [SWAP]
├─nvme0n1p7 ext4 1.0 3644dc53-fc22-4192-a85e-fe54987dae2d 50.2G 52% /var/snap/firefox/common/host-hunspell
│ /
├─nvme0n1p8 ext4 1.0 6a982e39-9594-43e5-9328-d95a092945f8
└─nvme0n1p9 ntfs FA2E08952E084D57

发现 6a982e39 磁盘还在,对应设备 nvme0n1p8,只是加载不上来,这种情况下可以运行命令尝试修复:

1
e2fsck -y /dev/nvme0n1p8

之后重启可以正常进入系统。

参考资料



文章链接:
https://www.zywvvd.com/notes/system/linux/ubuntu-home-crash/ubuntu-home-crash/


“觉得不错的话,给点打赏吧 ୧(๑•̀⌄•́๑)૭”

微信二维码

微信支付

支付宝二维码

支付宝支付

Ubuntu - Failed to start file system check on /dev/disk/by-uuid/...
https://www.zywvvd.com/notes/system/linux/ubuntu-home-crash/ubuntu-home-crash/
作者
Yiwei Zhang
发布于
2024年11月29日
许可协议