系统管理指南:设备和文件系统

创建和检查磁盘标号

标记磁盘通常是在系统安装过程中或者创建新磁盘片时进行的。如果磁盘标号已损坏,则可能需要重新标记磁盘。例如,磁盘标号因电源故障而损坏。

format 实用程序会尝试自动配置任何未标记的 SCSI 磁盘。如果 format 实用程序能够自动配置未标记的磁盘,则它将显示与以下内容类似的消息:


	c0t0d1: configured with capacity of 4.00GB

提示 –

有关标记具有相同磁盘标号的多个磁盘的信息,请参见使用 prtvtocfmthard 命令标记多个磁盘


Procedure如何标记磁盘

可以使用接下来的过程执行以下操作:

如果要用标号 EFI 标记小于 1 TB 的磁盘,请参见示例 12–6

  1. 成为超级用户或承担等效角色。

  2. 调用 format 实用程序。


    # format
    

    将显示可用磁盘的编号列表。

  3. 键入要标记的磁盘的编号。


    Specify disk (enter its number):1
    

    如果 format 实用程序识别该磁盘类型,则下一步是搜索备份标号以标记磁盘。使用备份标号标记磁盘时,会以正确的分区信息、磁盘类型和磁盘几何参数标记磁盘。

  4. 选择以下内容之一以标记磁盘:

    • 如果磁盘是未标记的但已成功配置,请转至步骤 5 标记磁盘。

      format 实用程序将询问您是否要标记磁盘。

    • 如果已标记磁盘但您要更改磁盘类型,或者如果 format 实用程序无法自动配置磁盘,请继续执行步骤 6 设置磁盘类型并标记磁盘。

  5. 通过在 Label it now? 提示符下键入 y 来标记磁盘。


    Disk not labeled. Label it now? y
    

    现在已标记磁盘。转至步骤 10 以退出 format 实用程序。

  6. format> 提示符下输入 type


    format> type
    

    将显示 "Available Drive Types" 菜单。

  7. 从可能的磁盘类型列表中选择一种磁盘类型。


    Specify disk type (enter its number)[12]: 12
    

    或者,选择 0 自动配置 SCSI-2 磁盘。有关更多信息,请参见如何自动配置 SCSI 驱动器

  8. 标记磁盘。如果磁盘未标记,则显示以下消息。


    Disk not labeled. Label it now? y
    

    否则,将显示以下消息提示您:


    Ready to label disk, continue? y
    
  9. 验证磁盘标号。


    format> verify 
    
  10. 退出 format 实用程序。


    format> q
    
    #

示例 12–5 标记磁盘

以下示例说明如何自动配置并标记 1.05 GB 磁盘。


# format

	c1t0d0: configured with capacity of 1002.09MB

 

AVAILABLE DISK SELECTIONS:

	  0. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>

     /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0

	  1. c1t0d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>

     /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0

Specify disk (enter its number): 1

Disk not labeled.  Label it now?  yes

format> verify

format> q

#


示例 12–6 用标号 EFI 标记小于 1 TB 的磁盘

以下示例说明如何使用 format -e 命令以标号 EFI 标记小于 1 TB 的磁盘。请记住验证分层软件产品是否继续在包含标号 EFI 的磁盘的系统上起作用。有关 EFI 标号限制的常规信息,请参见EFI 磁盘标号限制


# format -e

Searching for disks...done

AVAILABLE DISK SELECTIONS:

       1. c1t0d0 <SUNW18g cyl 7506 alt 2 hd 19 sec 248>

          /sbus@2,0/QLGC,isp@2,10000/sd@0,0

       2. c1t1d0 <SUNW18g cyl 7506 alt 2 hd 19 sec 248>

          /sbus@2,0/QLGC,isp@2,10000/sd@1,0

       3. c1t8d0 <SUNW18g cyl 7506 alt 2 hd 19 sec 248>

          /sbus@2,0/QLGC,isp@2,10000/sd@8,0

       4. c1t9d0 <SUNW18g cyl 7506 alt 2 hd 19 sec 248>

          /sbus@2,0/QLGC,isp@2,10000/sd@9,0

Specify disk (enter its number): 4

selecting c1t9d0

[disk formatted]

format> label

[0] SMI Label

[1] EFI Label

Specify Label type[0]: 1

Ready to label disk, continue? yes

format> quit

Procedure如何检查磁盘标号

使用 prtvtoc 命令检查磁盘标号信息。有关磁盘标号的详细说明和 prtvtoc 命令所显示的信息,请参见第 11 章,管理磁盘(概述)

  1. 成为超级用户或承担等效角色。

  2. 显示磁盘标号信息。


    # prtvtoc /dev/rdsk/device-name
    

    其中 device-name 是要检查的原始磁盘设备。


示例 12–7 检查磁盘标号

以下示例说明标号为 VTOC 的磁盘的磁盘标号信息。


# prtvtoc /dev/rdsk/c0t0d0s0

* /dev/rdsk/c0t0d0s0 partition map

*

* Dimensions:

*     512 bytes/sector

*      63 sectors/track

*      15 tracks/cylinder

*     945 sectors/cylinder

*    8894 cylinders

*    8892 accessible cylinders

*

* Flags:

*   1: unmountable

*  10: read-only

*

*                          First     Sector    Last

* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory

       0      2    00    1048950   3381210   4430159   /

       1      3    01          0   1048950   1048949

       2      5    00          0   8402940   8402939

       7      8    00    4430160   3972780   8402939   /export/home

以下示例说明标号为 EFI 的磁盘的磁盘标号信息。


# prtvtoc /dev/rdsk/c3t1d0s0

* /dev/rdsk/c3t1d0s0 partition map

*

* Dimensions:

*     512 bytes/sector

* 2479267840 sectors

* 2479267773 accessible sectors

*

* Flags:

*   1: unmountable

*  10: read-only

*

*                          First      Sector       Last

* Partition  Tag  Flags    Sector     Count        Sector  Mount Directory

       0      2    00          34      262144      262177

       1      3    01      262178      262144      524321

       6      4    00      524322  2478727100  2479251421

       8     11    00  2479251422       16384  2479267805