Oracle Solaris ZFS 管理指南

确定数据损坏的类型

缺省情况下,zpool status 命令仅说明已出现损坏,而不说明出现此损坏的位置。例如:


# zpool status monkey
  pool: monkey
 state: ONLINE
status: One or more devices has experienced an error resulting in data
        corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
        entire pool from backup.
   see: http://www.sun.com/msg/ZFS-8000-8A
 scrub: scrub completed after 0h0m with 8 errors on Tue Jul 13 13:17:32 2010
config:

        NAME        STATE     READ WRITE CKSUM
        monkey      ONLINE       8     0     0
          c1t1d0    ONLINE       2     0     0
          c2t5d0    ONLINE       6     0     0

errors: 8 data errors, use '-v' for a list

每个错误仅指示在给定时间点出现了错误。每个错误不一定仍存在于系统上。一般情况下是如此。某些临时故障可能会导致数据损坏,故障结束后会自动修复。完整的池清理可保证检查池中的每个活动块,因此每当清理完成后都会重置错误日志。如果确定错误不再存在,并且不希望等待清理完成,则使用 zpool online 命令重置池中的所有错误。

如果数据损坏位于池范围内的元数据中,则输出稍有不同。例如:


# zpool status -v morpheus
  pool: morpheus
    id: 1422736890544688191
 state: FAULTED
status: The pool metadata is corrupted.
action: The pool cannot be imported due to damaged devices or data.
   see: http://www.sun.com/msg/ZFS-8000-72
config:

        morpheus    FAULTED   corrupted data
          c1t10d0   ONLINE

如果出现池范围的损坏,池将被置于 FAULTED 状态,这是因为池无法提供所需的冗余级别。