如何让 Windows 进入 grub 菜单?使用两个硬盘;首先是 Windows 引导加载程序

如何让 Windows 进入 grub 菜单?使用两个硬盘;首先是 Windows 引导加载程序

这是一些背景。我有一个 1TB 硬盘,里面装有 Windows。分区是这样的:

第一个硬盘的分区

我购买了另一个 2TB 硬盘,并希望将 1TB 专用于 Windows,另一个专用于 Linux。这是第二个硬盘的屏幕截图。

第二块硬盘的分区表

正如你所看到的,sda2在安装 CentOS 7 时有 Windows 引导加载程序。我故意尝试在第一个硬盘驱动器中安装 CentOS 引导加载程序(即 grub?),以便 CentOS 可以检测到它。但似乎 CentOS 即使在那之后也无法检测到 Windows。

fdisk -l如果屏幕截图还不够,这是我的输出:

WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 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
Disk label type: gpt


#         Start          End    Size  Type            Name
 1           34       262177    128M  Microsoft reser Microsoft reserved partition
Partition 1 does not start on physical sector boundary.
 2       264192   1953646591  931.5G  Microsoft basic Basic data partition
 3   1953646592   1955743743      1G  Microsoft basic 
 4   1955743744   3907028991  930.5G  Linux LVM       
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sda: 1000.2 GB, 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
Disk label type: gpt


#         Start          End    Size  Type            Name
 1         2048       616447    300M  Windows recover Basic data partition
 2       616448       819199     99M  EFI System      EFI system partition
 3       819200      1081343    128M  Microsoft reser Microsoft reserved partition
 4      1081344   1048575999  499.5G  Microsoft basic Basic data partition
 5   1048576000   1887436799    400G  Microsoft basic Basic data partition
 6   1887436800   1953521663   31.5G  Microsoft basic Basic data partition
 7   1953521664   1953523711      1M  BIOS boot parti 

Disk /dev/mapper/cl-01: 981.9 GB, 981873983488 bytes, 1917722624 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


Disk /dev/mapper/cl-00: 17.2 GB, 17179869184 bytes, 33554432 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


Disk /dev/mapper/luks-13bc4611-477c-4df5-bfb7-b2bbd696e18b: 981.9 GB, 981871886336 bytes, 1917718528 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

研究了一下并发现我可以执行update-grub命令。但这在这里是不可能的。 CentOS 7 使用的 grub 与 Ubuntu 的 grub 不同(如果我错了,请纠正我)。

我还找到了一个grub2-mkconfig 方法,但此命令找不到 Windows 引导加载程序:

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-514.26.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.26.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-fd2ff737d87642cc87d59785cf5f2390
Found initrd image: /boot/initramfs-0-rescue-fd2ff737d87642cc87d59785cf5f2390.img
done

这是一台支持 UEFI 的计算机。


我有了一个发现,发现了这个:

在此输入图像描述

这个有什么用吗?

相关内容