UEFI 的 BCD 系統存放區設定BCD System Store Settings for UEFI

如需一般部署案例中,您不需要修改 BCD 存放區。For a typical deployment scenario, you do not need to modify the BCD store. 本主題討論各種的 BCD 設定,您可以修改 BCD 存放區中。This topic discusses the various BCD settings in the BCD store that you can modify. 在 UEFI 系統中,這包括下列的開機應用程式的設定:On UEFI systems, this includes settings for the following boot applications:

  1. Windows Boot ManagerWindows Boot Manager

  2. Windows 開機載入器Windows Boot Loader

  3. Windows 記憶體測試器Windows Memory Tester

下列各節描述這些詳細資料,以及如何修改 UEFI 系統的每個應用程式中的開機應用程式的每個可用的設定。The following sections describe the available settings for each of these boot applications in detail and how to modify each application for UEFI systems.

為了簡單起見,本章節中的 BCDEdit 範例會修改 BCD 系統存放區。For simplicity, the BCDEdit examples in this section modify the BCD system store. 若要修改另一個存放區,例如一份 BCD 範本中,納入命令列中的存放區名稱。To modify another store, such as a copy of the BCD-template, include the store name in the command line.

Windows 開機管理程式設定 uefiWindows Boot Manager Settings for UEFI

Windows 開機管理程式 ({bootmgr}) 管理的開機程序。Windows Boot Manager ({bootmgr}) manages the boot process. UEFI 型系統包含韌體開機管理程式 Bootmgfw.efi,載入的 EFI 應用程式,根據儲存在 NVRAM 中的變數。UEFI-based systems contain a firmware boot manager, Bootmgfw.efi, that loads an EFI application that is based on variables that are stored in NVRAM.

BCD 設定devicepath項目在 Windows 開機管理程式指出韌體開機管理程式。The BCD settings for the device and path elements in Windows Boot Manager indicate the firmware boot manager. 針對 Windows 命名 bcd-template 範本包含下列設定 Windows 開機管理程式的。The template that is named BCD-template for Windows includes the following settings for Windows Boot Manager.

## Windows Boot Manager

identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager

裝置設定Device Setting

device項目會指定包含 Windows 開機管理程式的磁碟區。The device element specifies the volume that contains Windows Boot Manager. 針對 UEFI 系統device元素 Windows 開機管理程式的設定為系統磁碟分割的磁碟區代號。For UEFI systems, the device element for Windows Boot Manager is set to the system partition volume letter. 若要判斷正確的磁碟區代號,請使用 Diskpart 工具來檢視磁碟分割。To determine the correct volume letter, use the Diskpart tool to view the disk partitions. 下列範例假設系統已經有多個資料分割,包括已指派磁碟機代號的 s。 系統磁碟分割的單一硬碟The following example assumes that the system has a single hard drive that has multiple partitions, including a system partition that has been assigned a drive letter of S.

下列 Diskpart 命令會選取磁碟 0,則列出該磁碟上,包括其磁碟機代號的磁碟區的詳細資料。The following Diskpart commands select disk 0 and then list the details of the volumes on that disk, including their drive letters. 它會顯示磁碟區 2 與系統磁碟分割。It shows volume 2 as the system partition.

DISKPART> select disk 0
DISKPART> list volume

  Volume ###  Ltr  Label   Fs     Type        Size     Status     Info
  ----------  ---  ------  -----  ----------  -------  ---------  ------
  Volume 0     D           NTFS   Partition    103 GB  Healthy
  Volume 1     C           NTFS   Partition     49 GB  Healthy    Boot
  Volume 2     S           FAT32  Partition    200 MB  Healthy    System

如果系統磁碟分割並沒有指派磁碟機代號,指派一個,方法是使用Diskpart 指派命令。If the system partition does not have an assigned drive letter, assign one by using the Diskpart assign command. 下列範例會假設系統磁碟分割是磁碟區 2,並將其指派成磁碟機代號 S。The following example assumes that the system partition is volume 2 and assigns it S as the drive letter.

Diskpart
select disk 0
list volume
select volume 2   // assuming volume 2 is the system partition
assign letter=s

確定系統磁碟分割磁碟區之後,設定device要對應的磁碟機代號的 Windows 開機管理程式的項目。After you have determined the system partition volume, set the device element for Windows Boot Manager to the corresponding drive letter. 下列範例會設定device到磁碟機 s。The following example sets device to drive S.

Bcdedit /set {bootmgr} device partition=s:// system partition

路徑設定Path Setting

path項目會指定該磁碟區上的 Windows 開機管理程式應用程式的位置。The path element specifies the location of the Windows Boot Manager application on that volume. 針對 UEFI 系統path指出韌體開機管理程式的路徑是\EFI\Microsoft\開機\Bootmgfw.efi。For UEFI systems, path indicates the firmware boot manager, whose path is \EFI\Microsoft\Boot\Bootmgfw.efi.

您可以確認 bcd-template 具有正確的路徑,列舉存放區中的值,如下所示:You can confirm that BCD-template has the correct path by enumerating the values in the store, as follows:

bcdedit /store bcd-template /enum all

若要明確設定path要\EFI\Microsoft\開機\Bootmgfw.efi,使用下列命令。To explicitly set path to \EFI\Microsoft\Boot\Bootmgfw.efi, use the following command.

Bcdedit /set {bootmgr} path \efi\microsoft\boot\bootmgfw.efi

其他設定Other Settings

您應該先設定 Windows 開機管理程式是在 UEFI 韌體的顯示順序中的第一個項目,如下列範例所示。You should set Windows Boot Manager to be the first item in the display order of the UEFI firmware, as shown in the following example.

Bcdedit /set {fwbootmgr} displayorder {bootmgr} /addfirst

您也應該指定最上層的 Windows 開機載入器應用程式中的 Windows 開機管理員顯示順序。You should also specify the topmost Windows boot loader application in the Windows Boot Manager display order. 下列範例示範如何將指定的 Windows 開機載入器,在頂端的顯示順序。The following example shows how to put a specified Windows boot loader at the top of the display order.

Bcdedit /set {bootmgr} displayorder {<GUID>} /addfirst

在上述範例中, <GUID>是指定的 Windows 開機載入器物件的識別碼。In the preceding example, <GUID> is the identifier for the specified Windows boot loader object. 下節會討論更詳細地這個識別項。The next section discusses this identifier in greater detail.

附註  具有多個已安裝的作業系統的多重開機系統有多個 Windows 開機載入器執行個體。Note   A multiboot system that has multiple installed operating systems has multiple instances of the Windows boot loader. 每個 Windows 開機載入器執行個體有自己的識別碼。Each instance of the Windows boot loader has its own identifier. 您可以設定預設的 Windows 開機載入器 ({default}) 任何這些識別項。You can set the default Windows boot loader ({default}) to any of these identifiers.

Windows 開機載入器設定Windows Boot Loader Settings

BCD 存放區有至少一個執行個體,並選擇性地多個執行個體,Windows 開機載入器。A BCD store has at least one instance, and optionally multiple instances, of the Windows boot loader. 個別的 BCD 物件代表每個執行個體。A separate BCD object represents each instance. 每個執行個體載入其中一個已安裝具有所指定物件的項目設定的 Windows 版本。Each instance loads one of the installed versions of Windows that has a configuration that the object's elements have specified. 每個 Windows 開機載入器物件都有自己的識別碼和物件的devicepath設定指出正確的分割區和開機應用程式。Each Windows boot loader object has its own identifier, and the object's device and path settings indicate the correct partition and boot application.

BCD-template for Windows 有具有下列設定的單一 Windows 開機載入器物件。BCD-template for Windows has a single Windows boot loader object that has the following settings.

## Windows Boot Loader

identifier              {9f25ee7a-e7b7-11db-94b5-f7e662935912}
device                  partition=C:
path                    \Windows\system32\winload.efi
description             Microsoft Windows Server
locale                  en-US
inherit                 {bootloadersettings}
osdevice                partition=C:
systemroot              \Windows

此 Windows 開機載入器的識別項是 {9f25ee7a-e7b7-11db-94b5-f7e662935912}。The identifier for this Windows boot loader is {9f25ee7a-e7b7-11db-94b5-f7e662935912}. 您可以在您的系統上使用此 GUID,或讓 BCDEdit 工具為您產生新的 GUID。You can use this GUID on your system or let the BCDEdit tool generate a new GUID for you.

若要簡化 BCDEdit 命令,您可以指定其中一個 Windows 開機載入器 BCD 系統中的儲存為預設的載入器。To simplify BCDEdit commands, you can specify one of the Windows boot loaders in the BCD system store as the default loader. 然後,您可以使用標準的識別項 ({default}) 來取代完整的 GUID。下列範例會指定與預設開機載入器,假設它會使用識別碼從 BCD 範本的 GUID efi 的 Windows 開機載入器。You can then use the standard identifier ({default}) in place of the full GUID.The following example specifies the Windows boot loader for EFI as the default boot loader, assuming that it uses the identifier GUID from BCD-template.

Bcdedit /default {9f25ee7a-e7b7-11db-94b5-f7e662935912}

裝置和 OSDevice 設定Device and OSDevice Settings

下列項目會指定索引鍵位置:The following elements specify key locations:

device項目會指定資料分割包含開機應用程式。The device element specifies the partition that contains the boot application.

osdevice項目會指定包含系統根磁碟分割。The osdevice element specifies the partition that contains the system root.

Windows 開機載入器 efi,這兩個項目通常會設定為 Windows 系統磁碟分割的磁碟機代號。For the Windows boot loader for EFI, both elements are usually set to the drive letter of the Windows system partition. 不過,如果已啟用 BitLocker 的電腦有多個安裝或 Windows,舊版osdevicedevice可能會設定為不同的分割區。BCD 範本會將這兩個項目設定為 C 磁碟機,也就是一般的值。However, if BitLocker is enabled or a computer has multiple installed versions of Windows, osdevice and device might be set to different partitions.BCD-template sets both elements to drive C, which is the typical value. 您可以明確地設定osdevicedevice值,如下列範例所示。You can also explicitly set the osdevice and device values, as shown in the following example. 此範例也會假設您已指定與預設開機載入器物件的 EFI 的 Windows 開機載入器。The example also assumes that you have specified the Windows boot loader for EFI as the default boot-loader object.

Bcdedit /set {default} device partition=c:
Bcdedit /set {default} osdevice partition=c:

路徑設定Path Setting

path Windows 開機載入器項目會指定該磁碟區上的開機載入器的位置。The path element of a Windows boot loader specifies the location of the boot loader on that volume. 針對 UEFI 系統pathefi,其是表示 Windows 開機載入器\Windows\System32\Winload.efi。For UEFI systems, path indicates the Windows boot loader for EFI, whose path is \Windows\System32\Winload.efi.

您可以確認 bcd-template 具有正確path列舉存放區中的值的值。You can confirm that BCD-template has the correct path value by enumerating the values in the store. 您可以明確地設定path值,如下列範例所示。You can also explicitly set the path value, as shown in the following example.

Bcdedit /set {default} path \windows\system32\winload.efi

Windows 記憶體測試器設定Windows Memory Tester Settings

Windows 記憶體測試器 ({memdiag}) 在開機時執行記憶體診斷。The Windows memory tester ({memdiag}) runs memory diagnostics at boot time. 應用程式的 BCD 設定devicepath項目指出正確的應用程式。The BCD settings for the application's device and path elements indicate the correct application.

附註  附註:Intel Itanium 電腦不會包含 Windows 記憶體測試器,而且不需要{memdiag}設定。Note   Note: Intel Itanium computers do not include a Windows memory tester and do not require {memdiag} settings.

Windows 的 BCD 範本具有下列設定。BCD-template for Windows has the following settings.

## Windows Memory Tester

identifier              {memdiag}
device                  partition=\Device\HarddiskVolume1
path                    \boot\memtest.exe
description             Windows Memory Diagnostic

裝置設定Device Setting

針對 UEFI 系統deviceWindows 記憶體測試器項目設定為系統磁碟分割的磁碟機代號。For UEFI systems, the device element for the Windows memory tester is set to the system partition drive letter. 下列範例會假設系統磁碟分割是 S 磁碟機,如先前範例中使用。The following example assumes that the system partition is drive S, as used in earlier examples.

Bcdedit /set {bootmgr} device partition=s:  // system partition

路徑設定Path Setting

path項目會指定位置的 Windows Test Manager 的磁碟區上的device已指定項目。The path element specifies the location of Windows Test Manager on the volume that the device element has specified. 針對 UEFI 系統path指出應用程式的 EFI 版本 (\EFI\Microsoft\開機\Memtest.efi)。For UEFI systems, path indicates the EFI version of the application (\EFI\Microsoft\Boot\Memtest.efi).

您可以確認 bcd-template 具有正確path列舉存放區中的值的值。You can confirm that BCD-template has the correct path value by enumerating the values in the store. 您也可以使用 BCDEdit 工具,以明確地設定path值,如下列範例所示。You can also use the BCDEdit tool to explicitly set the path value, as shown in the following example.

Bcdedit /set {memdiag} path \efi\microsoft\boot\memtest.efi