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.  设置磁盘(任务)

SPARC: 设置磁盘(任务列表)

SPARC: 为 ZFS 文件系统设置磁盘

SPARC: 如何为 ZFS 根文件系统设置磁盘

SPARC: 为 ZFS 根文件系统创建磁盘分片

SPARC: 如何为 ZFS 根文件系统创建磁盘分片

SPARC: 如何为 ZFS 根文件系统安装引导块

SPARC: 如何为 ZFS 非根文件系统设置磁盘

x86: 为 ZFS 文件系统设置磁盘(任务列表)

x86: 为 ZFS 文件系统设置磁盘

x86: 如何为 ZFS 根文件系统设置磁盘

x86: 为 ZFS 根文件系统准备磁盘

如何重新创建 ZFS 根池 (EFI (GPT))

x86: 如何为 ZFS 根文件系统 (VTOC) 创建磁盘分片

x86: 如何替换 ZFS 根池磁盘 (EFI (GPT))

x86: 如何替换 ZFS 根池磁盘 (VTOC)

x86: 如何为 ZFS 根文件系统安装引导块

x86: 如何为 ZFS 非根文件系统设置磁盘

x86: 创建并更改 Solaris fdisk 分区

x86: 创建 fdisk 分区指南

x86: 如何创建 Solaris fdisk 分区

更改 fdisk 分区标识符

如何更改 Solaris fdisk 标识符

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

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

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

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

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

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

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

18.  管理磁带机(任务)

索引

x86: 为 ZFS 文件系统设置磁盘(任务列表)

以下任务列表说明了在基于 x86 的系统中为 ZFS 根文件系统设置 ZFS 根池磁盘的过程。

任务
说明
参考
1. 为 ZFS 根文件系统设置磁盘。
ZFS 根文件系统的磁盘

连接新磁盘或替换现有根池磁盘,并从本地或远程 Oracle Solaris DVD 进行引导。

2. 创建或更改 fdisk 分区(如有必要)。
磁盘必须包含有效的 Solaris fdisk 分区。
3. 重新创建根池或创建备用根池。
在出现故障的情况下,重新创建根池或创建备用根池。
4. 如果要使用 zpool replace 命令替换根池磁盘,请安装引导装载程序。
如果用 zpool replace 命令替换用于根池的磁盘,那么必须手动安装引导装载程序,以使系统可以从替换磁盘进行引导。
5. 为 ZFS 非根文件系统设置磁盘。
ZFS 非根文件系统的磁盘

连接磁盘。

x86: 为 ZFS 文件系统设置磁盘

虽然说明如何设置磁盘和创建 fdisk 分区的过程可以结合 ZFS 文件系统使用,但是 ZFS 文件系统不直接映射到磁盘或磁盘分片。必须创建 ZFS 存储池才能创建 ZFS 文件系统。有关更多信息,请参见《Oracle Solaris 11.1 管理:ZFS 文件系统》

根池包含用于引导 Oracle Solaris OS 的根文件系统。如果根池磁盘已损坏,且根池未进行镜像配置,则系统可能不会引导。

如果根池磁盘已损坏,有两种可以恢复的方法:

用于非根池中的磁盘通常包含用户或数据文件的空间。为了获得更多磁盘空间,可以向根池或非根池附加或添加另一个磁盘。

或者,可以使用以下方法替换池中损坏的磁盘:

通常情况下,在系统中设置磁盘取决于硬件,所以当在系统中添加或替换磁盘时,请查看硬件文档。如果需要将磁盘添加到现有的控制器中,那么这可能只是将磁盘插入空槽(如果系统支持热插拔)中的问题而已。如果需要配置新的控制器,请参见动态重新配置和热插拔

x86: 如何为 ZFS 根文件系统设置磁盘

有关替换磁盘的信息,请参阅硬件安装指南。

  1. 断开损坏的磁盘与系统之间的连接(如有必要)。
  2. 将替换磁盘连接至系统,并检查磁盘的物理连接。
  3. 根据从本地 Oracle Solaris DVD 还是从网络中的远程 Oracle Solaris DVD 引导,按照下表中的说明进行操作。
    引导类型
    操作
    从本地驱动器中的 Oracle Solaris DVD
    1. 确保 Oracle Solaris DVD 位于驱动器中。

    2. 选择从介质引导的选项

    从网络
    3. 选择从网络引导的选项。

x86: 为 ZFS 根文件系统准备磁盘

查看以下根池磁盘要求:

如何重新创建 ZFS 根池 (EFI (GPT))

如果需要重新创建 ZFS 根池或创建备用根池,请遵循以下过程。以下 zpool create 命令将使用正确的引导信息自动创建带 EFI (GPT) 标签的磁盘。

  1. 成为管理员。
  2. 标识根池的磁盘。

    使用 format 实用程序标识根池的磁盘。

    # format
    Searching for disks...done
    AVAILABLE DISK SELECTIONS:
           0. c6t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
              /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/sd@0,0
           1. c6t1d0 <FUJITSU-MAV2073RCSUN72G-0301-68.37GB>
              /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/sd@1,0
           2. c6t2d0 <FUJITSU-MAV2073RCSUN72G-0301-68.37GB>
              /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/sd@2,0
           3. c6t3d0 <FUJITSU-MAV2073RCSUN72G-0301 cyl 14087 alt 2 hd 24 sec 424>
              /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/sd@3,0
    Specify disk (enter its number): 
  3. 重新创建根池。
    # zpool create -B rpool mirror c1t0d0 c2t0d0

    如果要创建备用根池,请使用类似于以下内容的语法:

    # zpool create -B rpool2 mirror c1t0d0 c2t0d0
    # beadm create -p rpool2 solaris2
    # beadm activate -p rpool2 solaris2
  4. 如有必要,恢复根池快照。

    有关完整的 ZFS 根池恢复的信息,请参见《Oracle Solaris 11.1 管理:ZFS 文件系统》中的第 11  章 "归档快照和根池恢复"

x86: 如何为 ZFS 根文件系统 (VTOC) 创建磁盘分片

通常情况下,安装系统时,会自动安装根池磁盘。如果需要替换根池磁盘或将新磁盘附加作为镜像根池磁盘,请参见以下步骤。

有关 fdisk 分区的完整说明,请参见x86: 创建 fdisk 分区指南

  1. 成为管理员。
  2. 使故障磁盘脱机并取消其配置(如有必要)。

    有些硬件要求您在尝试通过 zpool replace 操作替换故障磁盘之前,使磁盘脱机并取消其配置。例如:

    # zpool offline rpool c8t1d0s0
    # cfgadm -c unconfigure c8::dsk/c8t1d0
  3. 以物理形式将新磁盘或替换磁盘连接至系统(如有必要)。
    1. 以物理形式删除故障磁盘。
    2. 以物理形式插入替换磁盘。
    3. 配置替换磁盘(如有必要)。例如:
      # cfgadm -c configure c8::dsk/c28t1d0

      对于某些硬件,插入替换磁盘后不必对其进行重新配置。

  4. 通过查看格式化输出确认磁盘可存取。

    例如,format 命令显示 4 个连接至该系统的磁盘。

    # format -e
    AVAILABLE DISK SELECTIONS:
           1. c8t0d0 <Sun-STK RAID INT-V1.0 cyl 17830 alt 2 hd 255 sec 63>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@0,0
           2. c8t1d0 <Sun-STK RAID INT-V1.0-136.61GB>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@1,0
           3. c8t2d0 <Sun-STK RAID INT-V1.0-136.61GB>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@2,0
           4. c8t3d0 <Sun-STK RAID INT-V1.0-136.61GB>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@3,0
  5. 选择用于 ZFS 根池的磁盘。
    Specify disk (enter its number): 1
    selecting c8t1d0
    [disk formatted]
    .
    .
    .
    format>
  6. 查看 fdisk 分区的状态。
    • 如果磁盘不具有 fdisk 分区,您将看到类似于以下内容的消息:

      format> fdisk
      No Solaris fdisk partition found.

      如果这样,请转到下一步创建 fdisk 分区。

    • 如果磁盘具有 EFI fdisk 或某些其他分区类型,请转至下一步创建 Solaris fdisk 分区。

    • 如果磁盘具有 Solaris fdisk 分区,请转至步骤 9 为根池创建磁盘分片。

  7. 如有必要,请通过选择 fdisk 选项创建 Solaris fdisk 分区。
    format> fdisk
    No fdisk table exists. The default partition for the disk is:
    
      a 100% "SOLARIS System" partition
    
    Type "y" to accept the default partition,  otherwise type "n" to edit the
     partition table. y
  8. 如果磁盘具有 EFI fdisk 分区,那么将需要创建 Solaris fdisk 分区。

    如果使用 format 实用程序打印磁盘的分区表,并且看见该分区表指向第一个扇区和大小,那么这就是一个 EFI 分区。将需要按照以下操作创建 Solaris fdisk 分区:

    1. 从格式化选项中选择 fdisk
      # format -e c8t1d0
      selecting c8t1d0
      [disk formatted]
      format> fdisk
    2. 选择选项 3 删除现有 EFI 分区,删除分区。
      Enter Selection: 3
      Specify the partition number to delete (or enter 0 to exit): 1
      Are you sure you want to delete partition 1? This will make all files and 
      programs in this partition inaccessible (type "y" or "n"). y
      
      
      Partition 1 has been deleted.
    3. 选择选项 1 创建新的 Solaris 分区,创建分区。
      Enter Selection: 1
      Select the partition type to create: 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
      Partition 1 is now the active partition.
    4. 更新磁盘配置并退出。
      Enter Selection: 6
      format> 
    5. 显示 SMI 分区表。如果已应用缺省分区表,那么分片 0 的大小可能为 0,或者可能太小。请参见下一步。
      format> partition
      partition> print
  9. 通过显示分区(分片)信息确认磁盘具有标签 SMI,并查看分片 0 的大小信息。

    设置浮动分区,以使所有未分配的磁盘空间集中在分片 0 中。然后,按下 "return"(返回)键通过分片大小字段来创建一个大的分片 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 - 17829      136.58GB    (17830/0/0) 286438950
      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        7.84MB    (1/0/0)         16065
      9 alternates    wm       0                0         (0/0/0)             0
    
    Do you wish to continue creating a new partition
    table based on above table[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 - 17829      136.58GB    (17829/0/0) 286422885
      1       swap    wu       0                0         (0/0/0)             0
      2     backup    wu       0 - 17829      136.58GB    (17830/0/0) 286438950
      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        7.84MB    (1/0/0)         16065
      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
    Enter table name (remember quotes): "c8t0d0"
    
    Ready to label disk, continue? yes
  10. 使 ZFS 分辨出故障磁盘已替换。
    # zpool replace rpool c8t1d0s0
    # zpool online rpool c8t1d0s0

    对于某些硬件,插入替换磁盘后不必使其联机。

    如果正在附加新磁盘来创建镜像根池或附加较大的磁盘来替换较小的磁盘,请使用与以下语法类似的语法:

    # zpool attach rpool c8t0d0s0 c8t1d0s0

    对根池磁盘执行的 zpool attach 操作将自动应用引导块。

  11. 如果使用新磁盘替换根池磁盘,请应用引导块。

    例如:

    # bootadm install-bootloader

    zpool replace 操作不会自动应用引导块。

  12. 验证您是否可以从新磁盘引导。
  13. 如果系统从新磁盘引导,则分离旧磁盘。

    仅在附加新磁盘来替换故障磁盘或较小磁盘时,本步骤才是必要步骤。

    # zpool detach rpool c8t0d0s0
  14. 通过重新配置系统的 BIOS,设置系统自动从新磁盘引导。

x86: 如何替换 ZFS 根池磁盘 (EFI (GPT))

通常情况下,安装系统时,会自动安装根池磁盘。如果需要替换根池磁盘或将新磁盘附加为镜像根池磁盘,请参见以下步骤。

大多数情况下,在 Oracle Solaris 11.1 中将为根池磁盘安装 EFI (GPT) 磁盘标签。

有关 fdisk 分区的完整说明,请参见x86: 创建 fdisk 分区指南

  1. 成为管理员。
  2. 使故障磁盘脱机并取消其配置(如有必要)。

    有些硬件要求您在尝试通过 zpool replace 操作替换故障磁盘之前,使磁盘脱机并取消其配置。例如:

    # zpool offline rpool c8t1d0
    # cfgadm -c unconfigure c8::dsk/c8t1d0
  3. 以物理形式将新磁盘或替换磁盘连接至系统(如有必要)。
    1. 以物理形式删除故障磁盘。
    2. 以物理形式插入替换磁盘。
    3. 配置替换磁盘(如有必要)。例如:
      # cfgadm -c configure c8::dsk/c8t1d0

      对于某些硬件,插入替换磁盘后不必对其进行重新配置。

  4. 通过查看格式化输出确认磁盘可存取。

    例如,format 命令显示 4 个连接至该系统的磁盘。

    # format -e
    AVAILABLE DISK SELECTIONS:
           1. c8t0d0 <Sun-STK RAID INT-V1.0 cyl 17830 alt 2 hd 255 sec 63>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@0,0
           2. c8t1d0 <Sun-STK RAID INT-V1.0-136.61GB>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@1,0
           3. c8t2d0 <Sun-STK RAID INT-V1.0-136.61GB>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@2,0
           4. c8t3d0 <Sun-STK RAID INT-V1.0-136.61GB>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@3,0
  5. 使 ZFS 分辨出故障磁盘已替换。
    # zpool replace rpool c8t1d0
    # zpool online rpool c8t1d0

    对于某些硬件,插入替换磁盘后不必使其联机。

    如果正在附加新磁盘来创建镜像根池或附加较大的磁盘来替换较小的磁盘,请使用与以下语法类似的语法:

    # zpool attach rpool c8t0d0 c8t1d0

    对根池磁盘执行的 zpool attach 操作将自动应用引导块。

    如果根池磁盘包含定制分区,则可能需要使用类似于以下内容的语法:

    # zpool attach rpool c8t0d0s0 c8t0d0
  6. 如果使用新磁盘替换根池磁盘,请应用引导块。

    例如:

    # bootadm install-bootloader

    对根池磁盘执行的 zpool replace 操作未自动应用引导块。

  7. 验证您是否可以从新磁盘引导。
  8. 如果系统从新磁盘引导,则分离旧磁盘。

    仅在附加新磁盘来替换故障磁盘或较小磁盘时,本步骤才是必要步骤。

    # zpool detach rpool c8t0d0
  9. 通过重新配置系统的 BIOS,设置系统自动从新磁盘引导。

x86: 如何替换 ZFS 根池磁盘 (VTOC)

通常情况下,安装系统时,会自动安装根池磁盘。如果需要替换根池磁盘或将新磁盘附加为镜像根池磁盘,请参见以下步骤。

有关 fdisk 分区的完整说明,请参见x86: 创建 fdisk 分区指南

  1. 成为管理员。
  2. 使故障磁盘脱机并取消其配置(如有必要)。

    有些硬件要求您在尝试通过 zpool replace 操作替换故障磁盘之前,使磁盘脱机并取消其配置。例如:

    # zpool offline rpool c8t1d0
    # cfgadm -c unconfigure c8::dsk/c8t1d0
  3. 以物理形式将新磁盘或替换磁盘连接至系统(如有必要)。
    1. 以物理形式删除故障磁盘。
    2. 以物理形式插入替换磁盘。
    3. 配置替换磁盘(如有必要)。例如:
      # cfgadm -c configure c8::dsk/c8t1d0

      对于某些硬件,插入替换磁盘后不必对其进行重新配置。

  4. 通过查看格式化输出确认磁盘可存取。

    例如,format 命令显示 4 个连接至该系统的磁盘。

    # format -e
    AVAILABLE DISK SELECTIONS:
           1. c8t0d0 <Sun-STK RAID INT-V1.0 cyl 17830 alt 2 hd 255 sec 63>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@0,0
           2. c8t1d0 <Sun-STK RAID INT-V1.0-136.61GB>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@1,0
           3. c8t2d0 <Sun-STK RAID INT-V1.0-136.61GB>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@2,0
           4. c8t3d0 <Sun-STK RAID INT-V1.0-136.61GB>
              /pci@0,0/pci10de,375@f/pci108e,286@0/disk@3,0
  5. 选择用于 ZFS 根池的磁盘。
    Specify disk (enter its number): 1
    selecting c8t1d0
    [disk formatted]
    .
    .
    .
    format>
  6. 查看 fdisk 分区的状态。
    • 如果磁盘不具有 fdisk 分区,您将看到类似于以下内容的消息:

      format> fdisk
      No Solaris fdisk partition found.

      如果这样,请转至步骤 4 创建 fdisk 分区。

    • 如果磁盘具有 EFI fdisk 或某些其他分区类型,请转至下一步创建 Solaris fdisk 分区。

    • 如果磁盘具有 Solaris fdisk 分区,请转至步骤 9 为根池创建磁盘分片。

  7. 如有必要,请通过选择 fdisk 选项创建 Solaris fdisk 分区。
    format> fdisk
    No fdisk table exists. The default partition for the disk is:
    
      a 100% "SOLARIS System" partition
    
    Type "y" to accept the default partition,  otherwise type "n" to edit the
     partition table. y
  8. 如果磁盘具有 EFI fdisk 分区,那么将需要创建 Solaris fdisk 分区。

    如果使用 format 实用程序打印磁盘的分区表,并且看见该分区表指向第一个扇区和大小,那么这就是一个 EFI 分区。将需要按照以下操作创建 Solaris fdisk 分区:

    • 从格式化选项中选择 fdisk

      # format -e c8t1d0
      selecting c8t1d0
      [disk formatted]
      format> fdisk
    • 选择选项 3 删除现有 EFI 分区,删除分区。

      Enter Selection: 3
      Specify the partition number to delete (or enter 0 to exit): 1
      Are you sure you want to delete partition 1? This will make all files and 
      programs in this partition inaccessible (type "y" or "n"). y
      
      
      Partition 1 has been deleted.
    • 选择选项 1 创建新的 Solaris 分区,创建分区。

      Enter Selection: 1
      Select the partition type to create: 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
      Partition 1 is now the active partition.
    • 更新磁盘配置并退出。

      Enter Selection: 6
      format> 
    • 显示 SMI 分区表。如果已应用缺省分区表,那么分片 0 的大小可能为 0,或者可能太小。请参见下一步。

      format> partition
      partition> print
  9. 通过显示分区(分片)信息确认磁盘具有标签 SMI,并查看分片 0 的大小信息。

    设置浮动分区,以使所有未分配的磁盘空间集中在分片 0 中。然后,按下 "return"(返回)键通过分片大小字段来创建一个大的分片 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 - 17829      136.58GB    (17830/0/0) 286438950
      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        7.84MB    (1/0/0)         16065
      9 alternates    wm       0                0         (0/0/0)             0
    
    Do you wish to continue creating a new partition
    table based on above table[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 - 17829      136.58GB    (17829/0/0) 286422885
      1       swap    wu       0                0         (0/0/0)             0
      2     backup    wu       0 - 17829      136.58GB    (17830/0/0) 286438950
      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        7.84MB    (1/0/0)         16065
      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
    Enter table name (remember quotes): "c8t1d0"
    
    Ready to label disk, continue? yes
  10. 使 ZFS 分辨出故障磁盘已替换。
    # zpool replace rpool c8t1d0s0
    # zpool online rpool c8t1d0s0

    对于某些硬件,插入替换磁盘后不必使其联机。

    如果正在附加新磁盘来创建镜像根池或附加较大的磁盘来替换较小的磁盘,请使用与以下语法类似的语法:

    # zpool attach rpool c8t0d0s0 c8t1d0s0

    对根池使用 zpool attach 命令时,将自动应用引导块。

  11. 如果使用新磁盘替换根池磁盘,请应用引导块。

    例如:

    # bootadm install-bootloader
  12. 验证您是否可以从新磁盘引导。
  13. 如果系统从新磁盘引导,则分离旧磁盘。

    仅在附加新磁盘来替换故障磁盘或较小磁盘时,本步骤才是必要步骤。

    # zpool detach rpool c8t1d0s0
  14. 通过重新配置系统的 BIOS,设置系统自动从新磁盘引导。

x86: 如何为 ZFS 根文件系统安装引导块

如果使用 zpool replace 命令替换根池磁盘,则必须安装引导装载程序。以下过程同时适用于 VTOC 和 EFI (GPT) 标签。

  1. 成为管理员。
  2. 在系统磁盘中安装引导块。
    # bootadm install-bootloader

    如果需要在备用根池中安装引导装载程序,则使用 -P(池)选项。

    # bootadm install-bootloader -P rpool2

    如果要安装 GRUB Legacy 引导装载程序,必须首先从系统中删除所有 GRUB 2 引导环境,然后再使用 installgrub命令。有关说明,请参见《引导和关闭 Oracle Solaris 11.1 系统》中的"在已安装 GRUB 2 的系统上安装 GRUB Legacy"

  3. 通过将系统重新引导至运行 3 级,验证是否安装了引导块。
    # init 6

x86: 如何为 ZFS 非根文件系统设置磁盘

如果设置结合 ZFS 非根文件系统使用的磁盘,在创建池或将磁盘添加到池中时,会自动重新为该磁盘设置标签。如果使用整个磁盘创建池,或者在将整个磁盘添加到 ZFS 存储池时,则会应用标签 EFI。有关 EFI 磁盘标签的更多信息,请参见EFI (GPT) 磁盘标签

通常,大多数现代的总线类型都支持热插拔。这说明可以将磁盘插入空槽中,而且系统识别该磁盘。有关热插拔设备的更多信息,请参见第 4 章

  1. 成为管理员。

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

  2. 将磁盘连接至系统,并检查磁盘的物理连接。

    有关详细信息,请参阅磁盘的硬件安装指南。

  3. 使故障磁盘脱机并取消其配置(如有必要)。

    有些硬件要求您在尝试通过 zpool replace 操作替换故障磁盘之前,使磁盘脱机并取消其配置。例如:

    # zpool offline tank c1t1d0
    # cfgadm -c unconfigure c1::dsk/c1t1d0
    <Physically remove failed disk c1t1d0>
    <Physically insert replacement disk c1t1d0>
    # cfgadm -c configure c1::dsk/c1t1d0

    对于某些硬件,插入替换磁盘后不必对其进行重新配置。

  4. 确认新磁盘可识别。

    检查 format 实用程序的输出来查看该磁盘是否列在 AVAILABLE DISK SELECTIONS(可用的磁盘选择)之下。然后,退出 format 实用程序。

    # format
  5. 使 ZFS 分辨出故障磁盘已替换(如有必要)。
    # zpool replace tank c1t1d0
    # zpool online tank c1t1d0

    确认新磁盘可重新同步。

    # zpool status tank
  6. 将新磁盘附加至现有的 ZFS 存储池(如有必要)。

    例如:

    # zpool attach tank mirror c1t0d0 c2t0d0

    确认新磁盘可重新同步。

    # zpool status tank

    有关更多信息,请参见《Oracle Solaris 11.1 管理:ZFS 文件系统》中的第 3  章 "管理 Oracle Solaris ZFS 存储池"