在预装了 WINDOWS 11 的基于 UEFI 的 HP PROBOOK 上,ubuntu 22.04 安装结束时 grub-install 失败

在预装了 WINDOWS 11 的基于 UEFI 的 HP PROBOOK 上,ubuntu 22.04 安装结束时 grub-install 失败

我正在尝试在基于 UEFI 且预装了 WINDOWS 11 的 HP PROBOOK 上安装(双启动)UBUNTU 22.04 LTS。

ubuntu 22.04 安装结束时 grub-install 失败。

将“ /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed”复制到“/boot/efi/EFI/ubuntu/grubx64.efi”时,Grub 安装失败,并出现“设备上没有剩余空间”错误

在实时 Ubuntu 系统终端上运行“df”命令的结果:

ubuntu@ubuntu:~$ df -h /boot/efi/EFI/ubuntu/
df: /boot/efi/EFI/ubuntu/: No such file or directory

ubuntu@ubuntu:~$ ls /boot/efi
ls: cannot access '/boot/efi': No such file or directory

ubuntu@ubuntu:~$ sudo mount /dev/nvme0n1p6 /mnt

ubuntu@ubuntu:~$ df -h /mnt/EFI/
df: /mnt/EFI/: No such file or directory

ubuntu@ubuntu:~$ ls /mnt
config-6.2.0-26-generic
initrd.img
memtest86+_multiboot.bin
vmlinuz-6.2.0-26-generic
efi
initrd.img-6.2.0-26-generic
memtest86+.bin
System.map-6.2.0-26-generic
grub
initrd.img.old
memtest86+.elf
vmlinuz

笔记:

  • 我为 ubuntu 分配了大约 200GB 的 SSD 空间
  • 我使用 RUFUS 创建了具有 GPT 和 UEFI 设置的可启动 USB 驱动器
  • 我也创建了 /boot 分区
  • HP 笔记本是全新的
  • 我已在 BIOS 设置中禁用了 SECURE-BOOT、FAST-BOOT 选项
  • 安装失败后我运行了启动修复

任何建议都值得赞赏。

谢谢和问候,Sudhish

来自启动修复 paste-bin 日志的快照:

chroot /mnt/boot-sav/nvme0n1p8 grub-install --version
grub-install (GRUB) 2.06-2ubuntu7.2
modprobe: FATAL: Module efivars not found in directory /lib/modules/6.2.0-26-generic
chroot /mnt/boot-sav/nvme0n1p8 modprobe efivars

chroot /mnt/boot-sav/nvme0n1p8 efibootmgr -v before grub install
EFI variables are not supported on this system.


chroot /mnt/boot-sav/nvme0n1p8 uname -r
6.2.0-26-generic

chroot /mnt/boot-sav/nvme0n1p8 grub-install --efi-directory=/boot/efi --target=x86_64-efi
Installing for x86_64-efi platform.
grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' to `/boot/efi/EFI/ubuntu/grubx64.efi': No space left on device.
Exit code: 1
df /dev/nvme0n1p1
mv winEFI cancelled (nvme0n1p1 full)

chroot /mnt/boot-sav/nvme0n1p8 /sbin/grub-install --efi-directory=/boot/efi --target=x86_64-efi --recheck
Installing for x86_64-efi platform.
/sbin/grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' to `/boot/efi/EFI/ubuntu/grubx64.efi': No space left on device.

chroot /mnt/boot-sav/nvme0n1p8 /sbin/grub-install --efi-directory=/boot/efi --target=x86_64-efi --no-nvram
Installing for x86_64-efi platform.
/sbin/grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' to `/boot/efi/EFI/ubuntu/grubx64.efi': No space left on device.
--no-nvram exit code: 1 Please report this message to [email protected]

chroot /mnt/boot-sav/nvme0n1p8 efibootmgr -v after grub install
EFI variables are not supported on this system.

Error: NVram is locked (Ubuntu not found in efibootmgr). Please report this message to [email protected]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


答案1

显然,在我的情况下,问题不在于 NVRAM,而在于只有 100MB 大小的 ESP/EFI 系统分区。我尝试在同一系统上安装以前版本的 ubuntu....18.04、16.04、14.04,最后 14.04 安装成功,没有任何 grub-install 错误,但当我启动已安装的 ubuntu 14,04 时,它警告我 /boot/efi 大小太小....这时我意识到,较新版本的 ubuntu 出现 grub-install 错误只是因为 ESP 或 EFI 系统分区大小太小[默认为 100MB]。我按照以下 YouTube 视频中的说明增加了 EFI 系统分区的大小

增加 EFI 系统分区大小 | MiniTool | Duaboot OS

链接:youtube.com/watch?v=HDa4hfGX5xE

按照视频中提到的步骤增加 ESP/EFI 系统分区的大小后,每次后续 ubuntu 安装都成功,并且没有任何 grub-install 错误。


对 Ubuntu/GRUB 用户的建议:

我猜想以下 grub-install 错误消息应该更具体说明空间不足的设备/分区。这将为用户节省大量时间和精力。

ubuntu grub-installer: grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' to `/boot/efi/EFI/ubuntu/grubx64.efi': No space left on device.

**This should have been something like this :**

ubuntu grub-installer: grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' to `/boot/efi/EFI/ubuntu/grubx64.efi': **No space left on EFI partition mounted on /boot/efi**. ```


相关内容