Oracle Solaris ZFS 管理指南

ZFS 日志设备恢复

Solaris 10 10/09 发行版:在此发行版中,ZFS 使用 zpool status 命令确定意图日志故障。故障管理架构 (Fault Management Architecture, FMA) 也会报告这些错误。ZFS 和 FMA 都介绍如何从意图日志 (intent log) 故障中恢复。

例如,如果系统在将同步写操作提交给具有单独日志设备的池之前突然关闭,您将会看到类似以下内容的信息:


# zpool status -x
  pool: pool
 state: FAULTED
status: One or more of the intent logs could not be read.
        Waiting for adminstrator intervention to fix the faulted pool.
action: Either restore the affected device(s) and run 'zpool online',
        or ignore the intent log records by running 'zpool clear'.
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        pool        FAULTED      0     0     0 bad intent log
          mirror    ONLINE       0     0     0
            c0t1d0  ONLINE       0     0     0
            c0t4d0  ONLINE       0     0     0
        logs        FAULTED      0     0     0 bad intent log
          c0t5d0    UNAVAIL      0     0     0 cannot open

您可以通过以下方式解决日志设备故障:

要从此错误中恢复而不更换故障日志设备,可以使用 zpool clear 命令清除该错误。在这种情况下,池将在降级模式下运行,并且日志记录将被写入到主池,直到更换单独的日志设备。

请考虑使用镜像日志设备来避免日志设备故障情形。