无法导入 ZFS zpool,若未以只读形式导入则会导致恐慌

无法导入 ZFS zpool,若未以只读形式导入则会导致恐慌

重启后,ZFS 池一直尝试导入池。它阻止了启动顺序,我不得不将 /etc/zfs/zpool.cache 重命名为其他名称,以便启动系统。重启前进行了升级,但那与 zfs 无关。

问题是 zpool 数据存储无法以正常方式导入。只有在 readonly=on 时我才能导入它。此外,Scub 似乎在只读模式下处于活动状态,但它永远不会停止,因为无法写入池。我也无法停止清理,因为我只能在只读模式下导入它。

如果我以只读方式导入,它可以正常工作,我可以访问文件。但如果以正常方式导入,则会出现恐慌,并且进程会挂起。

有什么建议可以说明问题是什么吗?

#lsb_release -rd
Description:    Ubuntu 18.04.4 LTS
Release:        18.04

#apt-cache policy zfsutils-linux
zfsutils-linux:
  Installed: 0.7.5-1ubuntu16.9
  Candidate:    0.7.5-1ubuntu16.9


# dpkg -l | grep -i "zfs"

rc  libzfs1                                0.6.2-1~precise                                 amd64        Native ZFS filesystem library for Linux

rc  libzfs2                                0.6.5.4-1~precise                               amd64        Native OpenZFS filesystem library for Linux

ii  libzfs2linux                           0.7.5-1ubuntu16.9                               amd64        OpenZFS filesystem library for Linux

rc  libzpool1                              0.6.2-1~precise                                 amd64        Native ZFS pool library for Linux

rc  libzpool2                              0.6.5.4-1~precise                               amd64        Native OpenZFS pool library for Linux

ii  libzpool2linux                         0.7.5-1ubuntu16.9                               amd64        OpenZFS pool library for Linux

rc  ubuntu-zfs                             8~precise                                       amd64        Native ZFS filesystem metapackage for Ubuntu.

rc  zfs-dkms                               0.7.5-1ubuntu16.9                               all          OpenZFS filesystem kernel modules for Linux

ii  zfs-doc                                0.7.5-1ubuntu16.9                               all          Native OpenZFS filesystem documentation and examples.

ii  zfs-initramfs                          0.7.5-1ubuntu16.9                               all          OpenZFS root filesystem capabilities for Linux - initramfs

ii  zfs-zed                                0.7.5-1ubuntu16.9                               amd64        OpenZFS Event Daemon

rc  zfsutils                               0.6.5.4-1~precise                               amd64        Native OpenZFS management utilities for Linux

ii  zfsutils-linux                         0.7.5-1ubuntu16.9                               amd64        command-line tools to manage OpenZFS filesystems

还有一些 zpool 状态

#zpool status
no pools available

# zpool import
   pool: datastore
     id: 3190464655986727485
  state: ONLINE
 status: Some supported features are not enabled on the pool.
 action: The pool can be imported using its name or numeric identifier, though
        some features will not be available without an explicit 'zpool upgrade'.
 config:

        datastore   ONLINE
          raidz2-0  ONLINE
            sdb     ONLINE
            sdc     ONLINE
            sdd     ONLINE
            sde     ONLINE
            sdf     ONLINE
            sdg     ONLINE



# zpool import -o readonly=on datastore
# zpool status
  pool: datastore
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(5) for details.
  scan: scrub in progress since Sun May 10 00:24:01 2020
        15,1T scanned out of 15,1T at 1B/s, (scan is slow, no estimated time)
        1,44M repaired, 100,01% done
config:

        NAME        STATE     READ WRITE CKSUM
        datastore   ONLINE       0     0     0
          raidz2-0  ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
            sde     ONLINE       0     0     0
            sdf     ONLINE       0     0     0
            sdg     ONLINE       0     0     0

errors: No known data errors

如果我现在尝试以正常方式导入数据存储,它会出现紧急情况并挂起。

#zpool export datastore
#zpool import -F datastore

VERIFY3(c < (1ULL << 24) >> 9) failed (36028797018963967 < 32768)
PANIC at zio.c:266:zio_buf_alloc()

我还尝试使用 zdb 来查看它是否能发现任何错误。一段时间后,它会中断。

#set zfs:zfs_recover=1
#set aok=1
#zdb -e -bcsvL datastore

Traversing all blocks to verify checksums ...

2.29T completed ( 144MB/s) estimated time remaining: 25hr 46min 43sec        c < (1ULL << 24) >> 9 (0x7fffffffffffff < 0x8000)
ASSERT at ../../module/zfs/zio.c:266:zio_buf_alloc()Aborted (SIGABRT)

答案1

按顺序,尝试以下操作:

1) 导入只读文件,运行清理,等待其完成。然后再次尝试导入读写文件。

2) 升级到最新的 ZoL (0.8.4)。自 ZFS 0.7.5 以来,已进行了大量修复。请勿执行zpool upgrade。然后重新执行第 1 点)。

机器稳定吗?日志或 SMART 中没有 MCE 或磁盘错误?

相关内容