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

文档信息

前言

1.  Oracle Solaris ZFS 文件系统(介绍)

2.  Oracle Solaris ZFS 入门

3.  管理 Oracle Solaris ZFS 存储池

4.  管理 ZFS 根池组件

5.  管理 Oracle Solaris ZFS 文件系统

6.  使用 Oracle Solaris ZFS 快照和克隆

7.  使用 ACL 和属性保护 Oracle Solaris ZFS 文件

8.  Oracle Solaris ZFS 委托管理

9.  Oracle Solaris ZFS 高级主题

10.  Oracle Solaris ZFS 故障排除和池恢复

解决 ZFS 空间问题

ZFS 文件系统空间报告

ZFS 存储池空间报告

确定 ZFS 故障

ZFS 存储池中缺少设备

ZFS 存储池中的设备已损坏

ZFS 数据已损坏

检查 ZFS 文件系统完整性

文件系统修复

文件系统验证

控制 ZFS 数据清理

显式 ZFS 数据清理

ZFS 数据清理和重新同步

解决 ZFS 问题

确定 ZFS 存储池中是否存在问题

查看 zpool status 输出

总体池状态信息

池配置信息

清理状态

数据损坏错误

ZFS 错误消息的系统报告

修复损坏的 ZFS 配置

解决缺少设备的问题

以物理方式重新附加设备

将设备可用性通知 ZFS

更换或修复损坏的设备

确定设备故障的类型

清除瞬态错误

替换 ZFS 存储池中的设备

确定是否可以替换设备

无法替换的设备

替换 ZFS 存储池中的设备

查看重新同步状态

修复损坏的数据

确定数据损坏的类型

修复损坏的文件或目录

修复具有多块引用的损坏数据

修复 ZFS 存储池范围内的损坏

修复无法引导的系统

11.  归档快照和根池恢复

12.  建议的 Oracle Solaris ZFS 做法

A.  Oracle Solaris ZFS 版本说明

索引

解决缺少设备的问题

如果设备无法打开,则它在 zpool status 输出中显示为 UNAVAIL状态。此状态表示在首次访问池时 ZFS 无法打开设备,或者设备自那时以来已变得不可用。如果设备导致顶层虚拟设备不可用,则无法访问池中的任何内容。此外,池的容错能力可能已受到损害。无论哪种情况,只需要将设备重新附加到系统即可恢复正常操作。如果需要替换因发生故障而处于 UNAVAIL 状态的设备,请参见替换 ZFS 存储池中的设备

如果根池或镜像根池中的某个设备处于 UNAVAIL 状态,请查看以下参考文档:

例如,设备出现故障后,可能会在 fmd 的输出中看到类似于以下内容的消息:

SUNW-MSG-ID: ZFS-8000-QJ, TYPE: Fault, VER: 1, SEVERITY: Minor
EVENT-TIME: Wed Jun 20 13:09:55 MDT 2012
PLATFORM: ORCL,SPARC-T3-4, CSN: 1120BDRCCD, HOSTNAME: tardis
SOURCE: zfs-diagnosis, REV: 1.0
EVENT-ID: e13312e0-be0a-439b-d7d3-cddaefe717b0
DESC: Outstanding dtls on ZFS device 'id1,sd@n5000c500335dc60f/a' in pool 'pond'.
AUTO-RESPONSE: No automated response will occur.
IMPACT: None at this time.
REC-ACTION: Use 'fmadm faulty' to provide a more detailed view of this event. 
Run 'zpool status -lx' for more information. Please refer to the associated 
reference document at http://support.oracle.com/msg/ZFS-8000-QJ for the latest 
service procedures and policies regarding this diagnosis.

要查看有关设备问题和解决办法的更多详细信息,请使用 zpool status -v 命令。例如:

# zpool status -v
  pool: pond
 state: DEGRADED
status: One or more devices are unavailable in response to persistent errors.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or 'fmadm repaired', or replace the device
        with 'zpool replace'.
  scan: scrub repaired 0 in 0h0m with 0 errors on Wed Jun 20 13:16:09 2012
config:

        NAME                       STATE     READ WRITE CKSUM
        pond                       DEGRADED     0     0     0
          mirror-0                 ONLINE       0     0     0
            c0t5000C500335F95E3d0  ONLINE       0     0     0
            c0t5000C500335F907Fd0  ONLINE       0     0     0
          mirror-1                 DEGRADED     0     0     0
            c0t5000C500335BD117d0  ONLINE       0     0     0
            c0t5000C500335DC60Fd0  UNAVAIL      0     0     0

device details:

        c0t5000C500335DC60Fd0    UNAVAIL          cannot open
        status: ZFS detected errors on this device.
                The device was missing.
           see: http://support.oracle.com/msg/ZFS-8000-LR for recovery

从此输出中可以看到,设备 c0t5000C500335DC60Fd0 不起作用。如果您确定该设备有问题,请予以替换。

如有必要,可使用 zpool online 命令使替换的设备联机。例如:

如果 fmadm faulty 的输出标识出了该设备错误,请让 FMA 知道设备已被替换。例如:

# fmadm faulty
--------------- ------------------------------------  -------------- ---------
TIME            EVENT-ID                              MSG-ID         SEVERITY
--------------- ------------------------------------  -------------- ---------
Jun 20 13:15:41 3745f745-371c-c2d3-d940-93acbb881bd8  ZFS-8000-LR    Major    

Problem Status    : solved
Diag Engine       : zfs-diagnosis / 1.0
System
    Manufacturer  : unknown
    Name          : ORCL,SPARC-T3-4
    Part_Number   : unknown
    Serial_Number : 1120BDRCCD
    Host_ID       : 84a02d28

----------------------------------------
Suspect 1 of 1 :
   Fault class : fault.fs.zfs.open_failed
   Certainty   : 100%
   Affects     : zfs://pool=86124fa573cad84e/vdev=25d36cd46e0a7f49/pool_name=pond/vdev_
name=id1,sd@n5000c500335dc60f/a
   Status      : faulted and taken out of service

   FRU
     Name             : "zfs://pool=86124fa573cad84e/vdev=25d36cd46e0a7f49/pool_name=pond/vdev_
name=id1,sd@n5000c500335dc60f/a"
        Status        : faulty

Description : ZFS device 'id1,sd@n5000c500335dc60f/a' in pool 'pond' failed to
              open.

Response    : An attempt will be made to activate a hot spare if available.

Impact      : Fault tolerance of the pool may be compromised.

Action      : Use 'fmadm faulty' to provide a more detailed view of this event.
              Run 'zpool status -lx' for more information. Please refer to the
              associated reference document at
              http://support.oracle.com/msg/ZFS-8000-LR for the latest service
              procedures and policies regarding this diagnosis.

摘取 fmadm faulty 命令输出中 Affects: 部分的字符串,并将其包含在以下命令中,以便通知 FMA 该设备已替换:

# fmadm repaired zfs://pool=86124fa573cad84e/vdev=25d36cd46e0a7f49/pool_name=pond/vdev_
name=id1,sd@n5000c500335dc60f/a
fmadm: recorded repair to of zfs://pool=86124fa573cad84e/vdev=25d36cd46e0a7f49/pool_name=pond/vdev_
name=id1,sd@n5000c500335dc60f/a

最后一步是确认设备更换后的池正常运行。例如:

# zpool status -x tank
pool 'tank' is healthy

以物理方式重新附加设备

重新附加缺少的设备的具体方式取决于相关设备。如果设备是网络连接驱动器,则应该恢复与网络的连接。如果设备是 USB 设备或其他可移除介质,则应该将它重新附加到系统。如果设备是本地磁盘,则控制器可能已出现故障,以致设备对于系统不再可见。在这种情况下,应该替换控制器,以使磁盘重新可用。可能存在其他问题,具体取决于硬件的类型及其配置。如果驱动器出现故障,且对系统不再可见,则应该将该设备视为损坏的设备。按照更换或修复损坏的设备中概述的过程进行操作。

如果设备连接受到损害,池可能变为 SUSPENDED 状态。在设备问题得到解决之前,SUSPENDED 池一直处于 wait 状态。例如:

# zpool status cybermen
  pool: cybermen
 state: SUSPENDED
status: One or more devices are unavailable in response to IO failures.
        The pool is suspended.
action: Make sure the affected devices are connected, then run 'zpool clear' or
        'fmadm repaired'.
        Run 'zpool status -v' to see device specific details.
   see: http://support.oracle.com/msg/ZFS-8000-HC
  scan: none requested
config:

        NAME           STATE     READ WRITE CKSUM
        cybermen       UNAVAIL      0    16     0
            c8t3d0     UNAVAIL      0     0     0
            c8t1d0     UNAVAIL      0     0     0

当设备连接恢复后,请清除池或设备错误。

# zpool clear cybermen
# fmadm repaired zfs://pool=name/vdev=guid

将设备可用性通知 ZFS

将设备重新附加到系统后,ZFS 可能会也可能不会自动检测其可用性。如果池先前为 UNAVAILSUSPENDED 状态,或者在执行 attach 的过程中系统进行了重新引导,则 ZFS 在尝试打开该池时,会自动重新扫描所有设备。如果在系统运行时池的性能降低且设备已替换,则必须通知 ZFS 设备现在是可用的并可以使用 zpool online 命令重新打开。例如:

# zpool online tank c0t1d0

有关使设备联机的更多信息,请参见使设备联机