# 消息 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 子系统无法打开某个设备。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.bsdcn.org/zfs/zfs-xiao-xi/zfs-8000-2q.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
