CentOS 7:重新启动后,zfs 模块将无法加载,没有 /dev/zfs

CentOS 7:重新启动后,zfs 模块将无法加载,没有 /dev/zfs

959 天后,CentOS 7 系统需要重新启动,该系统在过去几年中一直完美地使用 ZFS。yum update那段时间我每个月跑步一次。

重启系统显然无法加载其 ZFS 模块,如下所示

# zpool list
/dev/zfs and /proc/self/mounts are required.
Try running 'udevadm trigger' and 'mount -t proc proc /proc' as root.
# modprobe zfs
modprobe: FATAL: Module zfs not found.
# uname -a
Linux foo 3.10.0-1160.49.1.el7.x86_64 #1 SMP Tue Nov 30 15:51:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
# yum install zfs zfs-kmod
Package zfs-0.7.13-1.el7_6.x86_64 already installed and latest version
Package kmod-zfs-0.7.13-1.el7_6.x86_64 already installed and latest version
Nothing to do

/proc已安装并且udevadm trigger没有任何效果。/dev/zfs不存在。 Grepping dmesg for ZFS(不区分大小写)为空。手动加载模块说

# modprobe zfs
modprobe: FATAL: Module zfs not found.

我很困惑。我怎样才能让 ZFS 再次运行?

编辑

一个问题是我的仓库/etc/yum.repos.d/zfs.repo仍然是 7.6,而是/etc/yum.repos.d/zfs.repo.rpmnew7.9。我保存了旧的 zfs.repo 并将 7.9 的 zfs.repo 复制到zfs.repo.然后再次按照 kABI 的说明进行操作。现在我得到了这个:

# yum install zfs
Resolving Dependencies
--> Running transaction check
---> Package spl.x86_64 0:0.7.13-1.el7_6 will be obsoleted
--> Processing Dependency: spl = 0.7.13 for package: kmod-spl-0.7.13-1.el7_6.x86_64
---> Package zfs.x86_64 0:0.7.13-1.el7_6 will be updated
--> Processing Dependency: zfs = 0.7.13 for package: kmod-zfs-0.7.13-1.el7_6.x86_64
---> Package zfs.x86_64 0:2.0.7-1.el7 will be obsoleting
--> Processing Dependency: libzpool4 = 2.0.7 for package: zfs-2.0.7-1.el7.x86_64
--> Processing Dependency: libzfs4 = 2.0.7 for package: zfs-2.0.7-1.el7.x86_64
--> Processing Dependency: libuutil3 = 2.0.7 for package: zfs-2.0.7-1.el7.x86_64
--> Processing Dependency: libnvpair3 = 2.0.7 for package: zfs-2.0.7-1.el7.x86_64
--> Processing Dependency: libzpool.so.4()(64bit) for package: zfs-2.0.7-1.el7.x86_64
--> Processing Dependency: libzfs_core.so.3()(64bit) for package: zfs-2.0.7-1.el7.x86_64
--> Processing Dependency: libzfs.so.4()(64bit) for package: zfs-2.0.7-1.el7.x86_64
--> Processing Dependency: libuutil.so.3()(64bit) for package: zfs-2.0.7-1.el7.x86_64
--> Processing Dependency: libnvpair.so.3()(64bit) for package: zfs-2.0.7-1.el7.x86_64
--> Running transaction check
---> Package kmod-zfs.x86_64 0:0.7.13-1.el7_6 will be updated
---> Package kmod-zfs.x86_64 0:2.0.7-1.el7 will be an update
---> Package libnvpair1.x86_64 0:0.7.13-1.el7_6 will be obsoleted
---> Package libnvpair3.x86_64 0:2.0.7-1.el7 will be obsoleting
---> Package libuutil1.x86_64 0:0.7.13-1.el7_6 will be obsoleted
---> Package libuutil3.x86_64 0:2.0.7-1.el7 will be obsoleting
---> Package libzfs2.x86_64 0:0.7.13-1.el7_6 will be obsoleted
---> Package libzfs4.x86_64 0:2.0.7-1.el7 will be obsoleting
---> Package libzpool2.x86_64 0:0.7.13-1.el7_6 will be obsoleted
---> Package libzpool4.x86_64 0:2.0.7-1.el7 will be obsoleting
---> Package spl.x86_64 0:0.7.13-1.el7_6 will be obsoleted
--> Processing Dependency: spl = 0.7.13 for package: kmod-spl-0.7.13-1.el7_6.x86_64
--> Finished Dependency Resolution
Error: Package: kmod-spl-0.7.13-1.el7_6.x86_64 (@zfs-kmod)
           Requires: spl = 0.7.13
           Removing: spl-0.7.13-1.el7_6.x86_64 (@zfs-kmod)
               spl = 0.7.13-1.el7_6
           Obsoleted By: zfs-2.0.7-1.el7.x86_64 (zfs-kmod)
               Not found
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

# yum install --skip-broken zfs
[...]
Packages skipped because of dependency problems:
    kmod-zfs-2.0.7-1.el7.x86_64 from zfs-kmod
    libnvpair3-2.0.7-1.el7.x86_64 from zfs-kmod
    libuutil3-2.0.7-1.el7.x86_64 from zfs-kmod
    libzfs4-2.0.7-1.el7.x86_64 from zfs-kmod
    libzpool4-2.0.7-1.el7.x86_64 from zfs-kmod
    zfs-2.0.7-1.el7.x86_64 from zfs-kmod

如何解决依赖问题?

答案1

959天没有重启?哇。我假设您没有使用kexec,这意味着您已经第一次启动了新内核。问题是您安装的 ZFS 模块是为不同的内核构建的,因此您现在无法加载它。

您的选择:

  • 尝试使用weak-modulesskript(weak-modules --add-kernel --no-initramfs如果 initramfs 中不需要 ZFS)。如果 kABI 没有更改,它会将模块符号链接到新/lib/module目录,以使其可与新内核一起使用。 (如果这确实是您第一次使用新内核,则可能存在 kABI 更改。)
  • 如果上述方法不起作用,您可以尝试重新安装软件包。 OpenZFS提到这个作为在 CentOS 小版本之间升级时的必要步骤。
    1. 您需要先删除现有的zfs,spl和包。kmod-zfsyum remove zfs spl kmod-zfs
    2. 安装 7.9 的最新存储库OpenZFS
    yum install https://zfsonlinux.org/epel/zfs-release.el7_9.noarch.rpm
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-zfsonlinux
    
    1. 从新添加的存储库zfs安装。kmod-zfs
  • 您还可以尝试安装数据管理系统模块(将在内核更新后自动重建)而不是您现在使用的 kmod 软件包。

相关内容