# 消息 ID：ZFS-8000-2Q

## 复制配置中设备缺失

|  类型  | 错误             |
| :--: | -------------- |
|  严重性 | 重要             |
|  描述  | 复制配置中的某个设备无法打开 |
| 自动响应 | 如果可用，将激活热备用    |
|  影响  | 存储池不再提供配置的复制级别 |

## 建议系统管理员采取的操作

### 对于活动池

如果在运行 `zpool import` 时遇到此错误，请参见下文。否则，请运行 `zpool status -x` 来确定哪个池出现故障：

```sh
# zpool status -x
  pool: test
 state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas exist for
        the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-2Q
 scrub: none requested
config:

        NAME                  STATE     READ WRITE CKSUM
        test                  DEGRADED     0     0     0
          mirror              DEGRADED     0     0     0
            c0t0d0            ONLINE       0     0     0
            c0t0d1            FAULTED      0     0     0  cannot open

errors: No known data errors
```

通过查找带有“cannot open”消息的 FAULTED（故障）设备来确定哪个设备无法打开。如果该设备被意外从系统中移除，请附加该设备然后使用 `zpool online` 将其上线：

```sh
# zpool online test c0t0d1
```

如果设备不再可用，可使用 `zpool replace` 命令替换该设备：

```sh
# zpool replace test c0t0d1 c0t0d2
```

如果设备已被同一物理插槽中的另一块磁盘替换，则可以使用命令 `zpool replace` 的单参数形式进行替换：

```sh
# zpool replace test c0t0d1
```

现有数据将被 resilver 到新设备。resilver 完成后，该设备将从池中移除。

### 对于已导出的池

如果在 `zpool import` 期间遇到此错误，表示系统未附加某个设备：

```sh
# zpool import
  pool: test
    id: 10121266328238932306
 state: DEGRADED
status: One or more devices are missing from the system.
action: The pool can be imported despite missing or damaged devices.  The
        fault tolerance of the pool may be compromised if imported.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-2Q
config:

        test              DEGRADED
          mirror          DEGRADED
            c0t0d0        ONLINE
            c0t0d1        FAULTED   cannot open
```

与池在系统中为活动状态不同，导出池时无法替换设备。如果设备可以附加到系统，请附加设备并再次运行 `zpool import`。

还可以按原样导入池，但由于缺失设备，池将处于 DEGRADED（降级）状态。该设备将被标记为 UNAVAIL（不可用）。导入池后，可以按上述方法替换缺失设备。

## 详细信息

消息 ID：`ZFS-8000-2Q` 表示 ZFS 子系统无法打开某个设备。
