在 Oracle® Solaris 11.2 中管理设备

退出打印视图

更新时间: 2014 年 7 月
 
 

创建磁盘标签

此过程适用于以下情况:

  • 系统安装期间。

  • 添加新磁盘时。

  • 磁盘标签损坏时。

  • 更改磁盘类型时。

如何为磁盘设置标签

  1. 在 Oracle Solaris 中启动 Format 实用程序。
    # format

    注 -  要应用 EFI 标签,请改为使用 format –e 命令语法。请参见Example 6–13

    显示磁盘的编号列表。

  2. 出现提示时,键入要设置标签的磁盘的编号。
  3. 如有必要,通过执行以下子步骤指定磁盘类型。

    仅当实用程序无法识别磁盘类型或想要更改磁盘类型时,才需要执行这些子步骤。否则,请继续下一步骤。

    1. format > 提示符下,选择 type
    2. 从可用选项中,键入与磁盘类型对应的编号。

      如果磁盘的类型为 SCSI-2,则可以通过键入零 (0) 选择自动配置磁盘。

  4. 为磁盘设置标签。

    根据所显示的提示执行以下步骤之一:

    • format > 提示符,键入 label,然后按照提示继续操作。

    • 在确认提示下,键入 y

  5. (u53ef选) 要验证标签设置过程的结果,请在 format > 提示符下键入 verify
  6. 退出 Format 实用程序。
示例 6-12  为磁盘设置标签

以下示例显示了如何自动配置新的且未设置标签的磁盘 (c2t1d0)。本示例的前提是已发出 format 命令并显示了磁盘列表。

# format
...
Specify disk (enter its number): 1
c2t1d0: configured with capacity of 33.92GB
Disk not labeled.  Label it now?  yes
format> verify
Information is displayed.
format> q
示例 6-13  用标签 EFI 为磁盘设置标签

以下示例显示了如何使用 format –e 命令为磁盘设置 EFI 标签。务必验证分层软件产品在磁盘带有 EFI 标签的系统上是否能够继续工作。有关 EFI 标签功能的常规信息,请参见EFI (GPT) 磁盘标签

本示例假定要设置标签的所选磁盘为 c2t3d0

# format -e
...
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[0]: 1
Ready to label disk, continue? yes
format> quit
示例 6-14  为磁盘设置 SMI 标签

以下示例将 SMI 标签应用到 c2t0d0。由于磁盘先前已设置了 EFI 标签,因此本示例包含警告。否则,标签设置过程将会继续,不会显示任何其他警告。

# format -e
...
Specify disk (enter its number): 3
selecting c2t0d0
[disk formatted]
...
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[1]: 0
Warning: This disk has an EFI label. Changing to SMI label will erase all
current partitions.
Continue? yes
Auto configuration via format.dat[no]?
Auto configuration via generic SCSI-2[no]?