gpt

在基本 GUID 分区表 (gpt) 磁盘上,此命令将 gpt 属性分配给具有焦点的分区。 gpt 分区属性指定有关使用分区的其他信息。 一些属性特定于分区类型 GUID。

必须选择基本 gpt 分区才能使此操作成功。 使用 select partition 命令选择一个基本 gpt 分区,并将焦点移到该分区上。

Caution

更改 gpt 属性可能会导致无法为基本数据卷分配驱动器号,或导致基本数据卷无法装载文件系统。 强烈建议不要更改 gpt 属性,除非你是原始设备制造商 (OEM) 或具有 gpt 磁盘方面的经验的 IT 专业人员。

Syntax

gpt attributes=<n>

Parameters

Parameter Description
attributes=<n> 指定要应用于具有焦点的分区的属性的值。 gpt 属性字段是包含两个子字段的 64 位字段。 较高的字段只能在分区 ID 的上下文中解释,而较低的字段常用于所有分区 ID。 支持的值包括:
  • 0x0000000000000001 - Specifies that the partition is required by the computer to function properly.
  • 0x8000000000000000 - Specifies that the partition won't receive a drive letter by default when the disk is moved to another computer, or when the disk is seen for the first time by a computer.
  • 0x4000000000000000 - Hides a partition's volume so it's not detected by the mount manager.
  • 0x2000000000000000 - Specifies that the partition is a shadow copy of another partition.
  • 0x1000000000000000 - Specifies that the partition is read-only. 此属性可防止写入卷。

For more information about these attributes, see the attributes section at create_PARTITION_PARAMETERS Structure.

Remarks

  • EFI 系统分区只包含启动操作系统所需的那些二进制。 这使得 OEM 二进制文件或特定于操作系统的二进制文件可以轻松地放置在其他分区中。

Examples

若要防止计算机在移动 gpt 磁盘时自动将驱动器号分配给具有焦点的分区,请键入:

gpt attributes=0x8000000000000000