升级发行版时出现 efi 系统分区问题

升级发行版时出现 efi 系统分区问题

我有双重启动win10/ubuntu-linux。我想升级我的Ubuntu 20.04到 20.10。但在过程中,我收到一条错误消息:

Efi 系统分区 (ESP) 不可用

我试过了:

sudo mount /boot/efi

之后我收到这个错误:

mount: /boot/efi: can't find UUID=0A0E-A110

但是我的 Linux 在 sda7 上具有不同的 UUID。因此我通过以下方式获取了 sda7 的 UUID:

sudo blkid /dev/sda7

输出:

/dev/sda7: UUID="fa092601-bef2-441e-92d4-2871f05e4a55" TYPE="ext4" PARTUUID="59087783-8cca-4a70-af2f-1472267b442c" 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/sda9 during installation
UUID=fa092601-bef2-441e-92d4-2871f05e4a55 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=0A0E-A110  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

所以我把这行添加到我的/etc/fstab

UUID=fa092601-bef2-441e-92d4-2871f05e4a55  /boot/efi       ext4    umask=0077      0       1

之后 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/sda9 during installation
UUID=fa092601-bef2-441e-92d4-2871f05e4a55 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=0A0E-A110  /boot/efi       vfat    umask=0077      0       1
UUID=fa092601-bef2-441e-92d4-2871f05e4a55  /boot/efi       ext4    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

我还评论了UUID=0A0E-A110。

但我总是收到同样的错误!

(注意:在使用 fstab 文件进行一些操作后,文件被损坏并且我的 Linux 启动失败!因此我使用实时 Linux 登录并恢复了 fstab!)

更新 该命令的输出:

sudo parted -l

是:

Model: ATA ST1000LM014-SSHD (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  106MB   105MB   fat32        EFI system partition          boot, esp
 2      106MB   123MB   16.8MB               Microsoft reserved partition  msftres
 3      123MB   157GB   157GB   ntfs         Basic data partition          msftdata
 4      157GB   157GB   522MB   ntfs                                       hidden, diag
 5      157GB   438GB   281GB   ntfs         Basic data partition          msftdata
 6      438GB   732GB   294GB   ntfs         Basic data partition          msftdata
 7      732GB   1000GB  268GB   ext4

答案1

谢谢@oldfred

问题在于 fstab 文件中的 vfat(FAT32)的 UUID 与我系统的实际 FAT32 分区之间的差异。因此我通过以下方式获取了真实 vfat 分区的 UUID:

lsblk -f

输出中有以下一行:

├─sda1 vfat     FAT32          2457-E435       

因此将 fstab vfat 分区 UUID 更改为上面得到的 2457-E435(更改了最后一行之前的行。UUID 部分):

# /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/sda9 during installation
UUID=fa092601-bef2-441e-92d4-2871f05e4a55 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation 0A0E-A110
UUID=2457-E435  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

问题解决了

相关内容