Linux中解决 zfs 安装后无法加载和使用,报错类似如下:modprobe: FATAL: Module zfs not found.

news2024/11/16 5:50:58

Linux中解决 zfs 安装后无法加载和使用,报错类似如下:modprobe: FATAL: Module zfs not found.

在这里插入图片描述

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

解决办法:

yum remove zfs spl kmod-zfs -y

yum update -y --skip-broken

os_v=$(cat /etc/redhat-release) # cat /etc/issue 
os_v=$(echo ${os_v#*.})
os_v=$(echo ${os_v%.*})
yum install http://download.zfsonlinux.org/epel/zfs-release.el7_${os_v}.noarch.rpm -y

yum install -y https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm



yum install zfs kmod-zfs -y

modprobe zfs

参考资料:

Step 1: Clean up and Reinstall DKMS Modules
Most of the time, the ZFS on Linux messes up the DKMS modules after the update. I suggest to clean up and reinstall DKMS modules once again. As of December 12, 2018, the ZFS on Linux will remove all of the DKMS modules for no reason.

First, check your DKMS status. You will need to clean up the DKMS if it is empty (nothing is installed), orphan (library is installed, but none of them is attached to any kernel) or multiple (multiple kernels installed). If it is clean (single kernel only), you may skip this step. If you are using ZFS on Linux ver 0.7.x, your DKMS will contain two modules (zfs and spl). If you are using ver. 0.8.x, your DKMS will contain one module only (zfs).

#dkms status

In general, all you want is only one version of DKMS modoule is installed, and it is attached to one kernel only. If you see multiple versions of DKMS modules, or multiple kernels, that’s bad.

#An example of dirty DKMS status (This is bad):
spl, 0.7.12, 3.10.0-862.14.4.el7: installed (original_module exists) (WARNING! Diff between built and installed module!)
spl, 0.7.12, 3.10.0-957.1.3.el7: installed (original_module exists)
zfs, 0.7.12, 3.10.0-862.14.4.el7: installed (original_module exists) (WARNING! Diff between built and installed module!)
zfs, 0.7.12, 3.10.0-957.1.3.el7: installed (original_module exists)
#An example of empty DKMS status (This is bad):
(empty)

#An example of DKMS status without kernal (This is bad):
zfs, 0.7.12: added
spl, 0.7.12: added

#An example of clean DKMS status (This is good):
spl, 0.7.12, 3.10.0-957.1.3.el7.x86_64, x86_64: installed
zfs, 0.7.12, 3.10.0-957.1.3.el7.x86_64, x86_64: installed 

or 

spl, 0.7.12, 3.10.0-957.1.3.el7.x86_64, x86_64: installed (original_module exists)
zfs, 0.7.12, 3.10.0-957.1.3.el7.x86_64, x86_64: installed (original_module exists)

or 

zfs, 0.8.3, 3.10.0-1127.el7.x86_64, x86_64: installed (original_module exists)
In my example above, my ZFS on Linux is 0.7.12, my old kernel is 3.10.0-862.14.4.el7, my new kernel is 3.10.0-957.1.3.el7. Your version may be different.

If your situation is something like the following:

Error! Could not locate dkms.conf file.
File: /var/lib/dkms/zfs/0.8.2/source/dkms.conf does not exist.

That means you have multiple versions of dkms-ZFS modules installed in your system. In my case, the 0.8.3 is running, and the old (0.8.2) is still available. Check the folder (/var/lib/dkms/zfs/) to see if any old libraries need to be removed.

#Currently running: dkms ZFS 0.8.3, kernel 3.10.0-1062.18.1.el7.x86_64

cd /var/lib/dkms/zfs/

#ls -al
total 12K
0.8.2 <---- Delete this 0.8.3 kernel-3.10.0-1062.1.2.el7.x86_64-x86_64 -> 0.8.2/3.10.0-1062.1.2.el7.x86_64/x86_64 <---- Delete this kernel-3.10.0-1062.4.1.el7.x86_64-x86_64 -> 0.8.2/3.10.0-1062.4.1.el7.x86_64/x86_64 <---- Delete this kernel-3.10.0-1062.4.3.el7.x86_64-x86_64 -> 0.8.2/3.10.0-1062.4.3.el7.x86_64/x86_64 <---- Delete this kernel-3.10.0-1062.7.1.el7.x86_64-x86_64 -> 0.8.2/3.10.0-1062.7.1.el7.x86_64/x86_64 <---- Delete this kernel-3.10.0-1062.9.1.el7.x86_64-x86_64 -> 0.8.3/3.10.0-1062.9.1.el7.x86_64/x86_64 <---- Delete this

You may want to remove both ZFS and SPL DKMS modules first, then reinstall them:

#If your version is 0.7.x:
sudo dkms remove zfs/0.7.12 --all; 
sudo dkms remove spl/0.7.12 --all; 


#If your version is 0.8.x:
sudo dkms remove zfs/0.8.3 --all; 

Sometimes, you will need to remove the old kernel manually:

sudo dkms remove zfs/0.7.12 -k 3.10.0-862.14.4.el7.x86_64; 
sudo dkms remove spl/0.7.12 -k 3.10.0-862.14.4.el7.x86_64;

Time to reinstall them:

#Don't forget to use the version that matches your system. In my situation, it was 0.7.12 / 0.8.3

#0.7.x:
sudo dkms --force install spl/0.7.12; 
sudo dkms --force install zfs/0.7.12;

#0.8.x:
sudo dkms --force install zfs/0.8.3;

Run the DKMS status again. You should see both ZPL and SPL are attached to the new kernel:

#If your version is 0.7.x:
spl, 0.7.12, 3.10.0-957.1.3.el7.x86_64, x86_64: installed
zfs, 0.7.12, 3.10.0-957.1.3.el7.x86_64, x86_64: installed

#If your version is 0.8.x:
zfs, 0.8.3, 3.10.0-1127.el7.x86_64, x86_64: installed

Try to load the ZFS module and import your ZFS data:

sudo /sbin/modprobe zfs
sudo zpool import -a

If everything looks good, you can reboot your system and test to see if the ZFS is loaded automatically or not. Once everything is okay, remove the old kernel from the system.

sudo package-cleanup --oldkernels --count=1 -y

That’s it, you are good to go.

Step 2: Reinstall ZFS packages
If you have tried the first step and it didn’t work. You may want to reinstall the ZFS packages. Here is a typical error message:

You try to import the ZFS data and the system complains:

#zpool import -a
The ZFS modules are not loaded.
Try running '/sbin/modprobe zfs' as root to load them.

So you try to load the ZFS module and the system complains again:

#/sbin/modprobe zfs
modprobe: FATAL: Module zfs not found.
or
modprobe: ERROR: could not insert 'zfs': Invalid argument

What you need to do is to erase all the ZFS and related packages:

yum erase zfs zfs-dkms libzfs2 spl spl-dkms libzpool2 -y

Please reboot the system. This step is very important.

reboot

After that, try to install ZFS again.

yum install zfs -y

If the system complaints about mismatched dependent packages, try to remove the affected packages first and run the installation again.

After the installation, try to start the ZFS module:

/sbin/modprobe zfs
zpool import -a

If the ZFS is up and running, please clean up your DKMS from step 1. If it complains again, please follow the steps below:

Reboot
Clear the cache of the yum repository and try to update the system again. (sudo yum clean all)
Reboot to the latest kernel
Erase the ZFS and related packages, try it again.
Keep in mind that ZFS on Linux is based on DKMS, a very buggy and unreliable platform. Sometimes when you uninstall and install the packages, don’t expect that it will do the same thing as fresh install. Before you send your server to the landfill, try this:

Check the dkms status:

#dkms status
#version 0.7.x
zfs, 0.7.2: added
spl, 0.7.2: added

#version 0.8.x
zfs, 0.8.3: added

If you see this message, that means the ZFS packages have been installed, but the DKMS doesn’t know how to use it. You will need to tell DKMS about it:

#version 0.7.x
dkms --force install zfs/0.7.2
dkms --force install spl/0.7.2

#version 0.8.x
dkms --force install zfs/0.8.3
#Try to start ZFS again.
/sbin/modprobe zfs
zpool import -a

If you already tried it for more than 3 times without any luck, don’t waste your time. You may want to bring the ZFS disks to a different server. The new server should be able to recognize the ZFS disks. For the original server, you can connect to the ZFS disks on the new server via NFS using the original path. That will minimize the impact of changes.

Keep in mind that the ZFS version is very important. The server with newer ZFS version can read the ZFS disks created in older ZFS versions. You can always check the ZFS versions by running the following:

#Get the version of the host:
sudo zfs upgrade -v
sudo zpool upgrade -v


#Get the version of the ZFS disks:
sudo zfs get version
sudo zpool get version

Install ZFS
So you already installed the system on eMMC or SD? You might want to use ZFS on the hard disk(s)! We assume rootfs is already on eMMC (or microSD Card) and you want to store your data on HDDs in ZFS pool.

Note

This wiki does not cover root-on-zfs. (Although it should be also possible.)

Note

If this method fails you can try to build directly ZFS on your system with the following instructions.

Step 1 - Install ZFS

sudo armbian-config

Go to Software and install headers.

Kernel Headers

Once kernel headers installed, install ZFS with the following command:

sudo apt install zfs-dkms zfsutils-linux

Optional:

sudo apt install zfs-auto-snapshot

Reboot.

Step 2 - Prepare partitions
Use fdisk of gdisk to create necessary partitions on your hard drive. This is beyond scope of this wiki. When ready look for assigned uuids:

ls -l /dev/disk/by-partuuid/

Step 3 - Create ZFS pool

sudo zpool create -o ashift=12 -m /mypool mypool mirror /dev/disk/by-partuuid/abc123 /dev/disk/by-partuuid/xyz789
sudo zfs set atime=off mypool
sudo zfs set compression=on mypool

Of course you may use more disks and create raidz instead of mirror. Your choice. 😃

Note: Do not use /dev/sdXY names. Use uuids only. This way your system will still work when you remove a disk or change order of disks.

If your disks are SSDs, enable trim support:

sudo zpool set autotrim=on mypool

Step 4 - Reboot
After reboot make sure the pool was imported automatically:

zpool status

You should now have working system with root on eMMC and ZFS pool on HDD.

DKMS and kABI-tracking kmod style packages are provided for x86_64 RHEL- and CentOS-based distributions from the OpenZFS repository. These packages are updated as new versions are released. Only the repository for the current minor version of each current major release is updated with new packages.

To simplify installation, a zfs-release package is provided which includes a zfs.repo configuration file and public signing key. All official OpenZFS packages are signed using this key, and by default yum or dnf will verify a package’s signature before allowing it be to installed. Users are strongly encouraged to verify the authenticity of the OpenZFS public key using the fingerprint listed here.

Key location: /etc/pki/rpm-gpg/RPM-GPG-KEY-openzfs (previously -zfsonlinux)
Current release packages: EL7, EL8, EL9
Archived release packages: see repo page
Signing key1 (EL8 and older, Fedora 36 and older) pgp.mit.edu / direct link
Fingerprint: C93A FFFD 9F3F 7B03 C310 CEB6 A9D5 A1C0 F14A B620
Signing key2 (EL9+, Fedora 37+) pgp.mit.edu / direct link
Fingerprint: 7DC7 299D CF7C 7FD9 CD87 701B A599 FD5E 9DB8 4141

For EL7 run:

yum install https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm

and for EL8 and 9:

dnf install https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm

After installing the zfs-release package and verifying the public key users can opt to install either the DKMS or kABI-tracking kmod style packages. DKMS packages are recommended for users running a non-distribution kernel or for users who wish to apply local customizations to OpenZFS. For most users the kABI-tracking kmod packages are recommended in order to avoid needing to rebuild OpenZFS for every kernel update.

DKMS
To install DKMS style packages issue the following commands. First add the EPEL repository which provides DKMS by installing the epel-release package, then the kernel-devel and zfs packages. Note that it is important to make sure that the matching kernel-devel package is installed for the running kernel since DKMS requires it to build OpenZFS.

For EL6 and 7, separately run:

yum install -y epel-release
yum install -y kernel-devel
yum install -y zfs

And for EL8 and newer, separately run:

dnf install -y epel-release
dnf install -y kernel-devel
dnf install -y zfs

Note

When switching from DKMS to kABI-tracking kmods first uninstall the existing DKMS packages. This should remove the kernel modules for all installed kernels, then the kABI-tracking kmods can be installed as described in the section below.

kABI-tracking kmod
By default the zfs-release package is configured to install DKMS style packages so they will work with a wide range of kernels. In order to install the kABI-tracking kmods the default repository must be switched from zfs to zfs-kmod. Keep in mind that the kABI-tracking kmods are only verified to work with the distribution-provided, non-Stream kernel.

For EL6 and 7 run:

yum-config-manager --disable zfs
yum-config-manager --enable zfs-kmod
yum install zfs

And for EL8 and newer:

dnf config-manager --disable zfs
dnf config-manager --enable zfs-kmod
dnf install zfs

By default the OpenZFS kernel modules are automatically loaded when a ZFS pool is detected. If you would prefer to always load the modules at boot time you can create such configuration in /etc/modules-load.d:

echo zfs >/etc/modules-load.d/zfs.conf

Note

When updating to a new EL minor release the existing kmod packages may not work due to upstream kABI changes in the kernel. The configuration of the current release package may have already made an updated package available, but the package manager may not know to install that package if the version number isn’t newer. When upgrading, users should verify that the kmod-zfs package is providing suitable kernel modules, reinstalling the kmod-zfs package if necessary.

Previous minor EL releases
The current release package uses “ r e l e a s e v e r ” r a t h e r t h a n s p e c i f y a p a r t i c u l a r m i n o r r e l e a s e a s p r e v i o u s r e l e a s e p a c k a g e s d i d . T y p i c a l l y “ {releasever}” rather than specify a particular minor release as previous release packages did. Typically “ releaseverratherthanspecifyaparticularminorreleaseaspreviousreleasepackagesdid.Typically{releasever}” will resolve to just the major version (e.g. 8), and the resulting repository URL will be aliased to the current minor version (e.g. 8.7), but you can specify –releasever to use previous repositories.

[vagrant@localhost ~]$ dnf list available --showduplicates kmod-zfs
Last metadata expiration check: 0:00:08 ago on tor 31 jan 2023 17:50:05 UTC.
Available Packages
kmod-zfs.x86_64                          2.1.6-1.el8                          zfs-kmod
kmod-zfs.x86_64                          2.1.7-1.el8                          zfs-kmod
kmod-zfs.x86_64                          2.1.8-1.el8                          zfs-kmod
kmod-zfs.x86_64                          2.1.9-1.el8                          zfs-kmod
[vagrant@localhost ~]$ dnf list available --showduplicates --releasever=8.6 kmod-zfs
Last metadata expiration check: 0:16:13 ago on tor 31 jan 2023 17:34:10 UTC.
Available Packages
kmod-zfs.x86_64                          2.1.4-1.el8                          zfs-kmod
kmod-zfs.x86_64                          2.1.5-1.el8                          zfs-kmod
kmod-zfs.x86_64                          2.1.5-2.el8                          zfs-kmod
kmod-zfs.x86_64                          2.1.6-1.el8                          zfs-kmod
[vagrant@localhost ~]$

In the above example, the former packages were built for EL8.7, and the latter for EL8.6.

Testing Repositories
In addition to the primary zfs repository a zfs-testing repository is available. This repository, which is disabled by default, contains the latest version of OpenZFS which is under active development. These packages are made available in order to get feedback from users regarding the functionality and stability of upcoming releases. These packages should not be used on production systems. Packages from the testing repository can be installed as follows.

For EL6 and 7 run:

yum-config-manager --enable zfs-testing
yum install kernel-devel zfs

And for EL8 and newer:

dnf config-manager --enable zfs-testing
dnf install kernel-devel zfs

Note

Use zfs-testing for DKMS packages and zfs-testing-kmod for kABI-tracking kmod packages.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2068129.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

文献翻译什么软件好?文献翻译全文软件推荐这5个

处暑已过&#xff0c;秋风渐起&#xff0c;知识的田野也迎来了收获的季节。在学术研究的旅途中&#xff0c;我们常常需要跨越语言的界限&#xff0c;探寻远方的智慧。 每当面对厚重的外文文献&#xff0c;应该如何快速准确地转化为可读的中文呢&#xff1f;其实只要选择一款高…

加速指南:如何使用Kimi提升论文写作效率?

在学术研究领域&#xff0c;撰写论文是一项基础且关键的任务&#xff0c;它要求作者不仅要有扎实的专业知识&#xff0c;还要具备高效的信息处理能力和清晰的表达技巧。学术写作是一个复杂的过程&#xff0c;涉及多个阶段&#xff1a;从选题、资料搜集、论文结构设计&#xff0…

STM32(五):定时器——输出比较

定时器输出比较功能&#xff1a;输出PWM波形 OC&#xff08;Output Compare&#xff09;输出比较 输出比较可以通过比较CNT与CCR寄存器值的关系&#xff0c;来对输出电平进行置1、置0或翻转的操作&#xff0c;用于输出一定频率和占空比的PWM波形。 每个高级定时器和通用定时器…

【硬件模块】红外跟随避障模块

红外跟随避障模块实物图 红外避障模块不断发射红外信号&#xff0c;当红外信号&#xff1a; 有反射回来&#xff0c;OUT 输出低电平&#xff0c;输出指示灯&#xff08;绿灯&#xff09;亮&#xff1b; 没反射回来&#xff0c;OUT 输出高电平&#xff0c;输出指示灯&#xff08…

tcp通信以及wireshark抓包

loop: //本地回环测试 tcp在传输时&#xff0c;有可能就会将两次发送的内容粘到一起&#xff0c;这是由于tcp的第三个特点&#xff1a;字节流式传输。它不一定会将两次发送出来的数据进行严格区分。这种现象在tcp链接中叫粘包。 但是socket在底层发送东西的时候是会在一段时间…

【微信小程序】使用 npm 包 - API Promise化-- miniprogram-api-promise

1. 基于回调函数的异步 API 的缺点 默认情况下&#xff0c;小程序官方提供的异步 API 都是基于回调函数实现的&#xff0c;例如&#xff0c;网络请求的 API 需要按照如下的方式调用&#xff1a; 缺点&#xff1a;容易造成回调地狱的问题&#xff0c;代码的可读性、维护性差&a…

I2C软件模拟与Delay寄存器延迟函数

环境 芯片:STM32F103ZET6 库&#xff1a;来自HAL的STM32F1XX.H 原理图 有图可知SCL和SDA两条线接到了PB10和PB11 Driver_I2C.h #ifndef __DRIVER_I2C #define __DRIVER_I2C#include "stm32f1xx.h" #include "Com_Delay.h" // 定义拉高SCL引脚的宏操作 #…

【电子数据取证】应用程序提取及固定

文章关键词&#xff1a;电子数据取证、手机取证、计算机取证、计算机仿真、云取证 一、前言 在数字化时代&#xff0c;电子数据已成为现代社会不可或缺的一部分&#xff0c;它不仅记录着个人的日常生活轨迹&#xff0c;也承载着企业运营的核心信息&#xff0c;更在司法体系中…

Nginx知识详解(理论+实战更易懂)

目录 一、Nginx架构和安装 1.1 Nginx 概述 1.1.1 nginx介绍 1.1.2 Nginx 功能介绍 1.1.3 基础特性 1.1.4 Web 服务相关的功能 1.2 Nginx 架构和进程 1.2.1 Nginx 进程结构 1.2.2 Nginx 进程间通信 1.2.3 Nginx 启动和 HTTP 连接建立 1.2.4 HTTP 处理过程 1.3 Nginx …

pdf转换成excel在线转换?这3款别错过

作为一名财务人员&#xff0c;我每天的工作都离不开处理大量的文件和数据。其中&#xff0c;将PDF格式的报表转换成Excel表格是一项经常要做的工作。在众多的PDF转换工具中&#xff0c;我试过了三款PDF转换工具&#xff0c;现在就来分享一下我的使用体验。 一、福昕PDF转换大师…

普元EOS-低开页面下拉选择控件加载列表数据

1 前言 普元EOS进行低代码开发页面可以高效提高开发效率&#xff0c;并且减少代码的出错机会。 在低代码开发页面的时候&#xff0c;表单页面中可以使用大量的常用控件。 本文将讲解下拉选择组件的使用。 2 下拉选择使用EOS内置字典作为数据源 下拉选择可从字典作为数据源&a…

25届网安秋招面试之后台信息泄露

吉祥知识星球http://mp.weixin.qq.com/s?__bizMzkwNjY1Mzc0Nw&mid2247485367&idx1&sn837891059c360ad60db7e9ac980a3321&chksmc0e47eebf793f7fdb8fcd7eed8ce29160cf79ba303b59858ba3a6660c6dac536774afb2a6330#rd 《网安面试指南》http://mp.weixin.qq.com/s…

C++ TinyWebServer项目总结(9. I/O 复用)

I/O 复用使得程序能够同时监听多个文件描述符&#xff0c;从而提高程序的性能。I/O 复用本身是阻塞的。Linux 下实现 I/O 复用的系统调用主要有 select、poll 和 epoll。 select 系统调用 select API select系统调用&#xff1a;在一段指定时间内&#xff0c;监听用户感兴趣…

Java语言程序设计——篇十七(1)

&#x1f33f;&#x1f33f;&#x1f33f;跟随博主脚步&#xff0c;从这里开始→博主主页&#x1f33f;&#x1f33f;&#x1f33f; 欢迎大家&#xff1a;这里是我的学习笔记、总结知识的地方&#xff0c;喜欢的话请三连&#xff0c;有问题可以私信&#x1f333;&#x1f333;&…

每日OJ_牛客_美国节日(日期模拟)

目录 牛客_美国节日&#xff08;日期模拟&#xff09; 解析代码 牛客_美国节日&#xff08;日期模拟&#xff09; 美国节日__牛客网 解析代码 题目表述很明白&#xff0c;难点在于要求一个月第N个星期W。那么面对这个问题&#xff0c;拆解的思路是&#xff0c;首先&#xff…

Navicat for MySQL:卓越的跨平台数据库管理开发工具

Navicat for MySQL是一款专为数据库管理员和开发人员设计的强大数据库管理开发工具&#xff0c;支持Mac和Windows操作系统&#xff0c;为用户提供了高效、便捷的数据库操作体验。无论是管理MySQL还是MariaDB数据库&#xff0c;Navicat for MySQL都能轻松胜任。 一、直观易用的…

DB-GPT开源项目文档入门

DB-GPT开源项目文档入门 (qq.com) 场景&#xff1a;服务中小金融机构、服务业小微商家 DB-GPT项目集成了多模型管理、多数据源管理、Text2SQL、增强检索RAG、生成式BI、多智能体&#xff0c;一个大而全的开源框架 项目基本信息 简介&#xff1a;一个原生数据应用开发框架 …

<数据集>流水线纸箱识别数据集<目标检测>

数据集格式&#xff1a;VOCYOLO格式 图片数量&#xff1a;1395张 标注数量(xml文件个数)&#xff1a;1395 标注数量(txt文件个数)&#xff1a;1395 标注类别数&#xff1a;2 标注类别名称&#xff1a;[GreenCarton,RedCarton] 序号类别名称图片数框数1GreenBox131728482R…

《计算机操作系统》(第4版)第9章 操作系统接口 复习笔记

第9章 操作系统接口 一、用户接口 1. 字符显示式联机用户接口 (1)命令行方式 该方式是以行为单位&#xff0c;输入和显示不同的命令。每行长度一般不超过256个字符&#xff0c;一般情况下&#xff0c;以回车符作 为一个命令的结束标记。通常&#xff0c;命令的执行采用的是间断…

抖音收回“作品代发布”能力?短视频矩阵工具未来何去何从?

相信不少朋友都看到过抖音开放平台的公示&#xff0c;从2024年7月20日开始&#xff0c;官方将要收回“代替用户发布内容到抖音”能力&#xff0c;如果你还在用原有抖音开放平台接口的矩阵系统&#xff0c;那可要注意及时调整了。 那未来的短视频矩阵工具还能用吗&#xff1f;矩…