重新启动 CentOS 服务器后,ZFS 不工作:
$ sudo zfs list
The ZFS modules are not loaded.
Try running '/sbin/modprobe zfs' as root to load them.
$ sudo modprobe zfs
modprobe: FATAL: Module zfs not found.
我的操作系统版本是CentOS Linux release 7.2.1511 (Core)
并uname -r
打印3.10.0-327.18.2.el7.x86_64
。
我注意到有些软件包似乎在机器启动时自动更新 - 我在以下位置找到了以下条目/var/log/yum.log
:
Feb 28 10:11:17 Updated: epel-release-7-9.noarch
Feb 28 10:11:29 Updated: openblas-openmp64-0.2.19-4.el7.x86_64
Feb 28 10:11:30 Updated: openblas-threads64_-0.2.19-4.el7.x86_64
Feb 28 10:11:31 Updated: openblas-openmp-0.2.19-4.el7.x86_64
Feb 28 10:11:32 Updated: openblas-serial64_-0.2.19-4.el7.x86_64
Feb 28 10:11:33 Updated: openblas-threads-0.2.19-4.el7.x86_64
Feb 28 10:11:34 Updated: openblas-threads64-0.2.19-4.el7.x86_64
Feb 28 10:11:35 Updated: openblas-0.2.19-4.el7.x86_64
Feb 28 10:11:36 Updated: openblas-openmp64_-0.2.19-4.el7.x86_64
Feb 28 10:11:37 Updated: openblas-serial64-0.2.19-4.el7.x86_64
Feb 28 10:11:37 Updated: openblas-devel-0.2.19-4.el7.x86_64
Feb 28 10:11:43 Updated: libtirpc-0.2.4-0.8.el7.x86_64
Feb 28 10:11:44 Updated: 1:nfs-utils-1.3.0-0.33.el7.x86_64
Feb 28 10:12:22 Installed: kernel-devel-3.10.0-514.6.2.el7.x86_64
Feb 28 10:12:27 Updated: x2goserver-4.0.1.20-1.el7.x86_64
Feb 28 10:12:27 Updated: x2goserver-xsession-4.0.1.20-1.el7.x86_64
从 来看dkms status
,似乎没有安装 ZFS:
$ sudo dkms status
nvidia, 352.93, 3.10.0-327.10.1.el7.x86_64, x86_64: installed
nvidia-uvm, 352.93, 3.10.0-327.10.1.el7.x86_64, x86_64: installed (original_module exists)
spl, 0.6.5.9: added
zfs, 0.6.5.9: added
nvidia-uvm, 352.93, 3.10.0-229.el7.x86_64, x86_64: installed-weak from 3.10.0-327.10.1.el7.x86_64
nvidia, 352.93, 3.10.0-327.18.2.el7.x86_64, x86_64: installed-weak from 3.10.0-327.10.1.el7.x86_64
nvidia-uvm, 352.93, 3.10.0-327.18.2.el7.x86_64, x86_64: installed-weak from 3.10.0-327.10.1.el7.x86_64
nvidia, 352.93, 3.10.0-327.4.4.el7.x86_64, x86_64: installed-weak from 3.10.0-327.10.1.el7.x86_64
nvidia-uvm, 352.93, 3.10.0-327.4.4.el7.x86_64, x86_64: installed-weak from 3.10.0-327.10.1.el7.x86_64
当我尝试这样做时dkms install
出现错误:
$ sudo dkms install zfs/0.6.5.9
Error! echo
Your kernel headers for kernel 3.10.0-327.18.2.el7.x86_64 cannot be found at
/lib/modules/3.10.0-327.18.2.el7.x86_64/build or /lib/modules/3.10.0-327.18.2.el7.x86_64/source.
的版本kernel-headers
似乎匹配kernel
,但是存储库中没有kernel-devel
相同版本的包。
$ yum list installed | grep kernel
kernel.x86_64 3.10.0-229.el7 @anaconda
kernel.x86_64 3.10.0-327.4.4.el7 @updates
kernel.x86_64 3.10.0-327.10.1.el7 @updates
kernel.x86_64 3.10.0-327.18.2.el7 @updates
kernel-devel.x86_64 3.10.0-327.28.3.el7 @updates
kernel-devel.x86_64 3.10.0-327.36.1.el7 @updates
kernel-devel.x86_64 3.10.0-327.36.2.el7 @updates
kernel-devel.x86_64 3.10.0-327.36.3.el7 @updates
kernel-devel.x86_64 3.10.0-514.6.2.el7 @updates
kernel-headers.x86_64 3.10.0-327.18.2.el7 @updates
kernel-tools.x86_64 3.10.0-327.18.2.el7 @updates
kernel-tools-libs.x86_64 3.10.0-327.18.2.el7 @updates
$ sudo yum install "kernel-devel-uname-r == $(uname -r)"
[...]
No package kernel-devel-uname-r == 3.10.0-327.18.2.el7.x86_64 available.
Error: Nothing to do
我该如何继续?
我考虑过升级内核(以发布514.6.2.el7
),但我不愿意这样做,因为我担心它可能会破坏一些东西。(我以临时管理员的身份继承了这台服务器,但我不了解它是如何配置的。)
答案1
跑步:
depmod -a; modprobe zfs
然后再次:
dkms build -m zfs -v $(zfsVersion)
答案2
每次内核版本更改时,您都必须升级 ZFS YUM 存储库,以便两个版本一致。然后更新 ZFS 和内核。