由于缺少一个设备,ZFS 池消失并显示“I/O 错误”

由于缺少一个设备,ZFS 池消失并显示“I/O 错误”

我有一个名为 3 个磁盘的 ZFS 池data。两个磁盘通过 ID 连接到 raidz,但第三个磁盘通过卷 ( sda) 连接。我物理移除了 sda 设备,因为我想通过名称连接它。但是当我重新启动时,该池不再可用。

两个磁盘 ID 驱动器仍显示为 ONLINE,但无法导入池并显示“无法导入‘数据’:I/O 错误”

我正在运行 Ubuntu Server。

命令输出:

$ sudo zpool status
no pools available
$ sudo zpool import
   pool: data
     id: 15166308533565302041
  state: FAULTED
status: One or more devices contains corrupted data.
 action: The pool cannot be imported due to damaged devices or data.
        The pool may be active on another system, but can be imported using
        the '-f' flag.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-5E
 config:

        data                                          FAULTED  corrupted data
          raidz1-0                                    DEGRADED
            ata-WDC_WD60EFAX-68JH4N1_WD-WX92D62J3PSZ  ONLINE
            ata-WDC_WD60EFZX-68B3FN0_WD-C82ELDYK      ONLINE
            sda                                       FAULTED  corrupted data
$ sudo zpool import -f
   pool: data
     id: 15166308533565302041
  state: FAULTED
status: One or more devices contains corrupted data.
 action: The pool cannot be imported due to damaged devices or data.
        The pool may be active on another system, but can be imported using
        the '-f' flag.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-5E
 config:

        data                                          FAULTED  corrupted data
          raidz1-0                                    DEGRADED
            ata-WDC_WD60EFAX-68JH4N1_WD-WX92D62J3PSZ  ONLINE
            ata-WDC_WD60EFZX-68B3FN0_WD-C82ELDYK      ONLINE
            sda                                       FAULTED  corrupted data
$ sudo zpool import -a
cannot import 'data': I/O error
        Destroy and re-create the pool from
        a backup source.
$ sudo zpool export data
cannot open 'data': no such pool
$ sudo zpool status -v
no pools available
$ sudo systemctl status zfs-import-cache
× zfs-import-cache.service - Import ZFS pools by cache file
     Loaded: loaded (/lib/systemd/system/zfs-import-cache.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2023-01-10 14:30:48 PST; 7min ago
       Docs: man:zpool(8)
    Process: 1174 ExecStart=/sbin/zpool import -c /etc/zfs/zpool.cache -aN $ZPOOL_IMPORT_OPTS (code=exited, status=1/FAILURE)
   Main PID: 1174 (code=exited, status=1/FAILURE)
        CPU: 44ms

Jan 10 14:30:48 ubuntu-server zpool[1174]: cannot import 'data': I/O error
Jan 10 14:30:48 ubuntu-server zpool[1174]: cannot import 'data': I/O error
Jan 10 14:30:48 ubuntu-server zpool[1174]:         Destroy and re-create the pool from
Jan 10 14:30:48 ubuntu-server zpool[1174]:         a backup source.
Jan 10 14:30:48 ubuntu-server zpool[1174]: cachefile import failed, retrying
Jan 10 14:30:48 ubuntu-server zpool[1174]:         Destroy and re-create the pool from
Jan 10 14:30:48 ubuntu-server zpool[1174]:         a backup source.
Jan 10 14:30:48 ubuntu-server systemd[1]: zfs-import-cache.service: Main process exited, code=exited, status=1/FAILURE
Jan 10 14:30:48 ubuntu-server systemd[1]: zfs-import-cache.service: Failed with result 'exit-code'.
Jan 10 14:30:48 ubuntu-server systemd[1]: Failed to start Import ZFS pools by cache file.

请帮我!

答案1

从错误消息来看,您似乎在另一台机器上安装(或尝试导入)了该池。您确定没有其他物理机或虚拟机尝试导入该池吗?

如果您确定没有其他机器尝试导入该池,请删除缓存文件并尝试强制导入:

rm -f /etc/zfs/zpool.cache; zpool import -f data

相关内容