JavaScript is required to for searching.
跳过导航链接
退出打印视图
Oracle Solaris 11.1 管理:设备和文件系统     Oracle Solaris 11.1 Information Library (简体中文)
search filter icon
search icon

文档信息

前言

1.  管理可移除介质(任务)

2.  写入 CD 和 DVD(任务)

3.  管理设备(任务)

4.  动态配置设备(任务)

5.  管理 USB 设备(任务)

6.  使用 InfiniBand 设备(概述/任务)

7.  管理磁盘(概述)

8.  管理磁盘使用(任务)

9.  管理磁盘(任务)

管理磁盘(任务列表)

确定系统中的磁盘

如何确定系统中的磁盘

格式化磁盘

如何确定磁盘是否已格式化

如何格式化磁盘

显示磁盘分片

如何显示磁盘分片信息

创建和检查磁盘标签

如何为磁盘设置标签

如何检查磁盘标签

恢复损坏的磁盘标签

如何恢复损坏的磁盘标签

添加第三方磁盘

10.  设置磁盘(任务)

11.  使用 COMSTAR 配置存储设备(任务)

12.  配置和管理 Oracle Solaris Internet 存储名称服务 (Internet Storage Name Service, iSNS)

13.  format 实用程序(参考信息)

14.  管理文件系统(概述)

15.  创建和挂载文件系统(任务)

16.  配置附加交换空间(任务)

17.  复制文件和文件系统(任务)

18.  管理磁带机(任务)

索引

创建和检查磁盘标签

为磁盘设置标签通常是在系统安装过程中或者使用新磁盘时进行的。如果磁盘标签已损坏,则可能需要重新为磁盘设置标签。例如,磁盘标签因电源故障而损坏。

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

    c2t3d0: configured with capacity of 136.73GB

如何为磁盘设置标签

如果要为小于 2 TB 的磁盘设置 EFI 标签,请参见示例 9-5

  1. 成为管理员。

    有关更多信息,请参见《Oracle Solaris 11.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 磁盘。

  8. 为磁盘设置标签。如果磁盘未设置标签,则显示以下消息。
    Disk not labeled. Label it now? y

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

    Ready to label disk, continue? y
  9. 验证磁盘标签。
    format> verify 
  10. 退出 format 实用程序。
    format> q
    #

示例 9-4 为磁盘设置标签

以下示例说明如何自动配置并为 36 GB 磁盘设置标签。

# format
AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@1c,600000/scsi@2/sd@0,0
       1. c0t1d0 <SEAGATE-ST336607LSUN36G-0307-33.92GB>
          /pci@1c,600000/scsi@2/sd@1,0
       2. c0t2d0 <SEAGATE-ST336607LSUN36G-0507-33.92GB>
          /pci@1c,600000/scsi@2/sd@2,0
       3. c0t3d0 <SEAGATE-ST336607LSUN36G-0507-33.92GB>
          /pci@1c,600000/scsi@2/sd@3,0
Specify disk (enter its number): 3
c0t3d0: configured with capacity of 33.92GB
Disk not labeled.  Label it now?  yes
format> verify
format> q

示例 9-5 用标签 EFI 为磁盘设置标签

以下示例说明如何使用 format -e 命令为磁盘设置 EFI 或 SMI (VTOC) 标签。请记住验证分层软件产品是否继续在包含标签 EFI 的磁盘的系统上起作用。有关 EFI 标签限制的常规信息,请参见EFI 磁盘标签限制

# format -e
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c2t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@0,0
       1. c2t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@1,0
       2. c2t2d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /pci@1c,600000/scsi@2/sd@2,0
       3. c2t3d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /pci@1c,600000/scsi@2/sd@3,0
Specify disk (enter its number): 3
selecting c2t3d0
[disk formatted]
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[0]: 1
Ready to label disk, continue? yes
format> quit

示例 9-6 将以 EFI 设置标签的磁盘更改为以 SMI 设置标签的磁盘

以下示例说明如何使用 format - e 命令将以 EFI 设置标签的磁盘更改为可以用于 ZFS 根池的以 SMI 设置标签的磁盘。

在基于 x86 的系统中,必须首先将 EFI fdisk 分区更改为 Solaris 分区。例如:

# format -e
select disk ...
format> fdisk
FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
             Total disk size is 17833 cylinders
             Cylinder size is 16065 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1                 EFI               0  17833    17834    100




SELECT ONE OF THE FOLLOWING:
   1. Create a partition
   2. Specify the active partition
   3. Delete a partition
   4. Change between Solaris and Solaris2 Partition IDs
   5. Edit/View extended partitions
   6. Exit (update disk configuration and exit)
   7. Cancel (exit without updating disk configuration)
Enter Selection: 3
Specify the partition number to delete (or enter 0 to exit): 1
This will make all files and 
programs in this partition inaccessible (type "y" or "n"). y
Enter Selection: 1
Select the partition type to create:
   1=SOLARIS2   2=UNIX      3=PCIXOS     4=Other        5=DOS12
   6=DOS16      7=DOSEXT    8=DOSBIG     9=DOS16LBA     A=x86 Boot
   B=Diagnostic C=FAT32     D=FAT32LBA   E=DOSEXTLBA    F=EFI (Protective)
   G=EFI_SYS    0=Exit? 1
Specify the percentage of disk to use for this partition
(or type "c" to specify the size in cylinders). 100
Should this become the active partition? If yes, it  will be activated
each time the computer is reset or turned on.
Please type "y" or "n". y
Enter Selection: 6
Partition 1 is now the active partition.

在基于 SPARC 的系统上,执行以下步骤:

# format -e
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c2t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@0,0
       1. c2t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@1,0
       2. c2t2d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /pci@1c,600000/scsi@2/sd@2,0
       3. c2t3d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /pci@1c,600000/scsi@2/sd@3,0
Specify disk (enter its number): 3
selecting c2t0d0
[disk formatted]
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[1]: 0
Ready to label disk, continue? yes

还应该检查缺省分区表,以确保其对于根池分片是最佳的,这表示大多数磁盘空间位于分片 0 中。请参见下面的步骤增加分片 0 的大小。

format> partition
partition> print
Current partition table (default):
Total disk cylinders available: 14085 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       1 -    13      129.19MB    (13/0/0)       264576
  1       swap    wu      14 -    26      129.19MB    (13/0/0)       264576
  2     backup    wu       0 - 14086      136.71GB    (14087/0/0) 286698624
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm      27 - 14084      136.43GB    (14058/0/0) 286108416
  7 unassigned    wm       0                0         (0/0/0)             0
  8       boot    wu       0 -     0        9.94MB    (1/0/0)         20352
  9 alternates    wm       0                0         (0/0/0)             0

partition> modify
Select partitioning base:
        0. Current partition table (default)
        1. All Free Hog
Choose base (enter number) [0]? 1

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0                0         (0/0/0)             0
  1       swap    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 14084      136.69GB    (14085/0/0) 286657920
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0
  8       boot    wu       0 -     0        9.94MB    (1/0/0)         20352
  9 alternates    wm       0                0         (0/0/0)             0

Do you wish to continue creating a new partition
table based on above table[yes]? yes
Free Hog partition[6]? 0
Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '7' [0b, 0c, 0.00mb, 0.00gb]: 

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       1 - 14084      136.68GB    (14084/0/0) 286637568
  1       swap    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 14084      136.69GB    (14085/0/0) 286657920
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0
  8       boot    wu       0 -     0        9.94MB    (1/0/0)         20352
  9 alternates    wm       0                0         (0/0/0)             0

Okay to make this the current partition table[yes]? yes
Enter table name (remember quotes): "c2t0d0" 
Ready to label disk, continue? yes
partition> quit
format> quit

如何检查磁盘标签

使用 prtvtoc 命令检查磁盘标签信息。有关磁盘标签的详细说明和 prtvtoc 命令所显示的信息,请参见第 7 章

  1. 成为管理员。

    有关更多信息,请参见《Oracle Solaris 11.1 管理:安全服务》中的"如何使用指定给您的管理权限"

  2. 显示磁盘标签信息。
    # prtvtoc /dev/rdsk/device-name

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

示例 9-7 检查磁盘标签

以下示例显示了标签为 VTOC 的磁盘的磁盘标签信息:

# prtvtoc /dev/rdsk/c2t3d0s0
* /dev/rdsk/c2t3d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*     848 sectors/track
*      24 tracks/cylinder
*   20352 sectors/cylinder
*   14089 cylinders
*   14087 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00          0 286698624 286698623
       2      5    01          0 286698624 286698623

以下示例显示了标签为 EFI 的根池磁盘的磁盘标签信息。

# prtvtoc /dev/dsk/c7t0d0s1
* /dev/dsk/c7t0d0s1 partition map
*
* Dimensions:
*     512 bytes/sector
* 156301488 sectors
* 156301421 accessible sectors
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*       First     Sector    Last
*       Sector     Count    Sector
*          34       222       255
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0     24    00        256    524288    524543
       1      4    00     524544 155760527 156285070
       8     11    00  156285071     16384 156301454
~#

以下示例显示了标签为 EFI 的非根池磁盘的磁盘标签信息。

# prtvtoc /dev/dsk/c8t3d0 
* /dev/dsk/c8t3d0 partition map
*
* Dimensions:
*     512 bytes/sector
* 143374738 sectors
* 143374671 accessible sectors
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*       First     Sector    Last
*       Sector     Count    Sector
*          34       222       255
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      4    00        256 143358065 143358320
       8     11    00  143358321     16384 143374704