/etc/fstab

/etc/fstab

由于硬件故障,我的主板刚刚更换。更换后,我的系统(Ubuntu 17.10)无法启动:

警告!UUID=dd84f4b3-d5bf-42e4-9b5e-ec685a461fad 不存在。已进入 shell。

我使用 Live USB Ubuntu 来调试这个问题。以下是一些结果:

/etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p3 during installation
UUID=dd84f4b3-d5bf-42e4-9b5e-ec685a461fad /               ext4    errors=remount-ro 0       1

# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=B38D-559B  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/nvme0n1p4 during installation
UUID=f4134c38-10b9-478f-b550-54650a9f5140 none            swap    sw              0       0

/dev/nvme0n1p1: SEC_TYPE="msdos" UUID="B38D-559B" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="98be6c97-c354-49a6-a432-9201d56a421b"
/dev/nvme0n1p2: LABEL="OS" UUID="B39E-7035" TYPE="vfat" PARTLABEL="fat32" PARTUUID="d3006358-8d82-4e0b-99f8-87a5261cf7e8"
/dev/nvme0n1p3: LABEL="UBUNTU" UUID="dd84f4b3-d5bf-42e4-9b5e-ec685a461fad" TYPE="ext4" PARTUUID="24e5b96d-f20c-43dd-9e48-672760b0e6f7"
/dev/sda1: LABEL="UBUNTU 17_1" UUID="88D4-322D" TYPE="vfat" PARTUUID="3d0a270b-01"

fdisk -l

Disk /dev/loop0: 1.3 GiB, 1427259392 bytes, 2787616 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 43E35EBE-2A73-404A-9D4A-851815F33F9A

Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1        34     488281    488248 238.4M EFI System
/dev/nvme0n1p2    488282    5934980   5446699   2.6G Microsoft basic data
/dev/nvme0n1p3   5935104  933576703 927641600 442.3G Linux filesystem
/dev/nvme0n1p4 933576704 1000214527  66637824  31.8G Linux swap


Disk /dev/sda: 28.7 GiB, 30752636928 bytes, 60063744 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3d0a270b

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1  *     2048 60063743 60061696 28.7G  c W95 FAT32 (LBA)

看起来 UUID 是fstab 正确的,但我仍然收到错误消息。

我如何修复我的 Ubuntu 安装?

我已经尝试过给定的解决方案警告!/dev/disk/by-uuid/xxxxxxxxx 不存在。转到 shell,但不幸的是这没有帮助(我安装了/dev/nvme0n1p3)。仍然是同样的问题。

更新:当我在系统设置中选择 UEFI 启动模式时,我仍然会遇到此问题。但是当我选择传统启动时,我得到了“未找到启动设备”的信息。但棘手的部分来了:当我选择传统模式并使用 F12 选择 UEFI/Ubuntu 时,它启动没有问题。

答案1

当我尝试使用 U 盘 Ubuntu 来解决这个问题时,我最终发现当 Legacy Boot 被禁用时,硬盘无法被识别。这解释了为什么手动选择 UEFI 确实有效。

问题是新主板有默认设置,因此启用了 RAID。切换到 AHCI 解决了我的问题。以下是更改它所需的步骤:(借用自这个答案

  1. 启动进入 BIOS(F12启动时)
  2. 选择Bios Setup
  3. 移至System ConfigurationSATA Operation并选择AHCI

答案2

答案包含在您的 fstab 文件本身中:

# / was on /dev/nvme0n1p3 during installation
UUID=dd84f4b3-d5bf-42e4-9b5e-ec685a461fad /               ext4    errors=remount-ro 0       1

# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=B38D-559B  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/nvme0n1p4 during installation
UUID=f4134c38-10b9-478f-b550-54650a9f5140 none            swap    sw              0       0

因此,请在 fstab 中将 UID 替换为旧名称:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system>  <mount point>   <type>  <options>       <dump>  <pass>
/dev/nvme0n1p3   /               ext4    errors=remount-ro 0       1
/dev/nvme0n1p1   /boot/efi       vfat    umask=0077      0       1
/dev/nvme0n1p4   none            swap    sw              0       0

然后重新启动。

如果这不能 100% 解决您的问题,那么真正的错误就更深了,您将必须比较新旧 MoBo 之间的 UEFI 设置。

答案3

在 Bios 中,RAID 已启用。切换到 AHCI 为我解决了这个问题。

答案4

我也遇到过这个问题,blkid 确认警报中的 UUID 是正确的。通过将 EFI 分区更改为 500 MB 并将根分区更改为 20 GB 解决了这个问题。显然,一些较旧的 BIOS 不喜欢超过 25GB 的根卷

编辑:实际上,在成功启动操作系统后,我能够在 GParted 中将根目录扩展到 100gb。也许是 500 MB EFI 分区实际上解决了这个问题。不确定。

相关内容