GRUB 2:Windows 10 不会自动添加,手动输入也不起作用

GRUB 2:Windows 10 不会自动添加,手动输入也不起作用

这里是我之前的问题的链接,询问此信息,但该信息已过时,因为当我最初安装 Windows 7 时 GRUB 无法工作。

我安装了曼扎罗在单独的驱动器上,但 Windows 7 未显示。我很沮丧,有点破坏了 Windows 7,将其替换为 Windows 10,现在正在尝试让 Windows 10 显示在 GRUB 中(Windows 10 可以工作)。

那么现在的过程。我对安装 Windows 有点太不信任了,因为之前我的系统被它弄乱了。因此,当我在 Windows 7 上安装 Windows 10 时,我物理上断开了其他驱动器的连接。

  1. 我将 Windows 10 放置在可启动 USB 驱动器上,并带有GPT分割。
  2. 安装了Windows 10。
  3. 重新启动至 Manjaro,并插入所有驱动器。
  4. sudo grub-mkconfigsudo update-grub,但是还是没有找到Windows

添加了自定义条目/etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "Windows 10" {
insmod part_gpt
insmod chain
set root='(hd4, msdos1)'
chainloader +1
}

没有任何成功。 GRUB 说“hd4,msdos2”未找到(或类似)。

我重新启动到 GRUB,在命令模式下运行,并列出所有使用ls.

我发现Windows 10已安装:

  • 系统保留(hd4,msdos1)
  • C:/(hd4,msdos2)

在 GRUB 中浏览ls (hd4,msdos2)/电喷文件位于:(hd4,msdos2)/Windows/Boot/EFI/bootmgfw.efi

我编辑/etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "Windows 10" {
insmod part_msdos
insmod ntfs
insmod chain
set root='(hd4, msdos2)'
chainloader /Windows/Boot/EFI/bootmgfw.efi
}

但没有任何成功。 GRUB 再次提示“hd4,msdos2”未找到(或类似)...

我应该怎么办?

我不确定 100%,但我确实相信我安装了 Manjaro(和 Windows 10)UEFI

输出sudo fdisk -l

Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 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: 0x0004e0a2

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1        2048 234438655 234436608 111.8G  7 HPFS/NTFS/exFAT


Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x0005e1a9

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdc1        2048 1953520064 1953518017 931.5G 83 Linux


Disk /dev/sdb: 111.8 GiB, 120034123776 bytes, 234441648 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: 0xaf87c8bd

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1        2048 234438655 234436608 111.8G  7 HPFS/NTFS/exFAT


Disk /dev/sdd: 931.5 GiB, 1000204886016 bytes, 1953525168 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: 0xc443369b

Device     Boot   Start        End    Sectors  Size Id Type
/dev/sdd1  *       2048    1026047    1024000  500M  7 HPFS/NTFS/exFAT
/dev/sdd2       1026048 1953521663 1952495616  931G  7 HPFS/NTFS/exFAT


Disk /dev/sde: 238.5 GiB, 256060514304 bytes, 500118192 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: D018CAAD-8426-4B8A-99FB-399757F9E3DB

Device         Start       End   Sectors  Size Type
/dev/sde1       2048   9884859   9882812  4.7G EFI System
/dev/sde2    9884860 494259859 484375000  231G Linux filesystem
/dev/sde3  494259860 500118158   5858299  2.8G Linux filesystem
  • /dev/sde1->/boot/efi
  • /dev/sde2->/
  • /dev/sde3->swap
  • /dev/sdc1->/home

/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>
UUID=596E-1D7B                            /boot/efi      vfat    defaults,noatime 0       2
UUID=e96e9dc6-b686-419c-8070-532b71f0631a /              ext4    defaults,noatime,discard 0       1
UUID=b0dedb36-a45d-407f-be01-1da38f343149 /home          ext4    defaults,commit=60,noatime 0       2
UUID=5acc3a2a-fc46-4d5d-916c-3e42f1b77141 swap           swap    defaults,noatime,discard 0       2
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0       0

#windows drive
#UUID=847ACFC37ACFAFEA                     /mnt/windows   ntfs    locale=en_US.utf8,dmask=022,fmask=022 0 2
#UUID=C810D31310D306FA                     /mnt/windows2  ntfs    locale=en_US.utf8,dmask=022,fmask=022 0 2

答案1

EFI 需要 GPT 文件系统。对于“msdos1”,请尝试“gpt1”。

抱歉,GPT 分区编号从 1 开始,而不是 0。您需要的编号是/boot/efi,它似乎是数字 1。

相关内容