grub2 加载 vfat 文件系统错误

grub2 加载 vfat 文件系统错误

经过半天的故障排除,我仍然无法正确启动 Arch。我使用双启动系统,Grub 通常可以正确启动 Arch,但经常发生这种情况:它尝试从未知的 vfat 文件系统加载并给出错误(vfat -> Windows 分区?)。因此,我尝试自定义 grub 启动菜单以添加正确的启动分区。

我目前拥有的:

$ lsblk
sda
|-sda1 nfts System-reserviert
|-sda2 ntfs Windows
|-sdaX ntfs Other partitions
sdb
|-sdb1 ext4 home                /home
sdc
|-sdc1 #1MB MBR
|-sdc2 ext2 boot                /boot
|-sdc3 f2fs root                /

sda 分区为 MBR,sdb 和 sdc 分区为 GPT。我有一台 BIOS 计算机。Archlinux 的安装按照 Archlinux wiki 中的说明进行。这两个系统过去和现在都可以正确启动,尽管我必须在 /etc/grub.d/40_custom 文件中手动添加 Windows。正如所说,有时找不到 Archlinux。我想通过为 Arch 添加自定义菜单项来解决这个问题。但现在 Grub 无法启动新条目,并抱怨我必须先加载内核。我该如何解决这个问题?

以下是我的 Grub 配置文件(注释已删除),其创建方式与Archlinux 维基

$ cat /etc/grub.d/40-custom
menuentry "Archlinux" {
     search --label --set-root=root "root"
     linux /boot/vmlinuz-linux root=/dev/disk/by-label/root rw
     initrd /boot/initramfs-linux.img
}
menuentry "Windows" {
     insmod part_msdos
     insmod nfts
     insmod ntldr
     search --label --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,mados1 --hint-baremetal=ahci,msdos1 "System-reserviert"
}

错误:没有这样的设备:root 错误:未找到文件 /boot/vmlinuz-linux 错误:您必须先加载内核

答案1

当您尝试手动编辑 Grub 时,它会非常挑剔。您可以通过这种方式破坏系统。这可能是一种偷偷摸摸但有效的方法;为什么不删除 grub 及其文件夹,重新安装 grub 并使用 os-prober?或者您可以尝试 syslinux,这可能更容易编辑但更精确。

相关内容