Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fix wrong KMOD version on Ubuntu? #9894

Closed
nicedevil007 opened this issue Jan 26, 2020 · 9 comments
Closed

How to fix wrong KMOD version on Ubuntu? #9894

nicedevil007 opened this issue Jan 26, 2020 · 9 comments
Labels
Type: Question Issue for discussion

Comments

@nicedevil007
Copy link

Hey there,

I updated my Ubuntu 19.10 from ZoL 0.8.2 to ZoL 0.8.3 today.
I used the install guide provided here.
After I installed all the *.deb packages that were created by make deb I checked the version of ZFS with zfs version.

The output is:

root@ubuntu:/nfs/zfs-0.8.3# zfs version
zfs-0.8.3-1
zfs-kmod-0.8.1-1ubuntu14.2

I never did an install of the original ZFS that is provided by Ubuntu itself. I did a fresh start 2 weeks ago with ZoL 0.8.2. I assume that zfs-kmod should be 0.8.3 as well.

If I take a look at the dpkg list I can't even find this package beeing installed.

Then I tryed installing the fresh compiled *.deb package for zfs-kmod with version 0.8.3 and was hoping that this will be installed over version 0.8.1. The output looks like this:

root@ubuntu:/nfs/zfs-0.8.3# dpkg -i kmod-zfs-devel_0.8.3-1_amd64.deb
(Reading database ... 81943 files and directories currently installed.)
Preparing to unpack kmod-zfs-devel_0.8.3-1_amd64.deb ...
Unpacking kmod-zfs-devel (0.8.3-1) over (0.8.3-1) ...
Setting up kmod-zfs-devel (0.8.3-1) ...

So 0.8.3 is already installed but won't be recognized by zfs version. What am I doing wrong?

@loli10K loli10K added the Type: Question Issue for discussion label Jan 26, 2020
@ghfields
Copy link
Contributor

As I use an Ubuntu liveCD and want to use a newer version of ZFS than what is in the kernel (pretty close to what you are trying to do), I do the following:

add-apt-repository -y ppa:<your choice of repository>
apt install -y zfs-dkms
systemctl stop zfs-zed.service
modprobe -r zfs
modprobe zfs

@nicedevil007
Copy link
Author

what repo do you install for it? Ubuntu 19.10 comes with ZFS 0.8.1, but I have to install it to use it.
I did a complete install with the ZoL package provided from this github repo and with the offical guide.

@ghfields
Copy link
Contributor

ghfields commented Jan 26, 2020

I did this with 18.04 LiveCDs to use 0.8.x repos. I used ppa:jonathonf/zfs, but that is not endorsed by the ZOL project. Currently, it allows 0.8.2 installs on Bionic (18.04). This is not what you are trying to accomplish. Recently, I've just relied on Focal (20.04) daily cd images for 0.8.2.

But.... the principle is the same. Install appropriate Deb package. Make sure you have installed the DKMS support so a kernel module will be built. systemctl stop zfs-zed.service (and export any pools) to allow for a clean modprobe -r zfs. After it has been cleared, modprobe zfs will pick up the dkms created kernel module.

What source did you use? Your

I used the install guide provided here.

didn't contain a link.

@nicedevil007
Copy link
Author

nicedevil007 commented Jan 26, 2020

Here are the steps I did to achieve my actual situation :)

apt install build-essential autoconf automake libtool gawk alien fakeroot dkms libblkid-dev uuid-dev libudev-dev libssl-dev zlib1g-dev libaio-dev libattr1-dev libelf-dev linux-headers-$(uname -r) python3 python3-dev python3-setuptools python3-cffi libffi-dev
wget https://github.com/zfsonlinux/zfs/releases/download/zfs-0.8.3/zfs-0.8.3.tar.gz
tar xvfz zfs-0.8.3.tar.gz
cd zfs-0.8.3/
./autogen.sh
./configure
make -s -j$(nproc)
make deb
dpkg -i *.deb

forgot the link I was using as the guide, sry:

Link

@nicedevil007
Copy link
Author

Mhhh I guess I found what was missing. Didn't do it because that was the section for the devs :)

There are a few helper scripts provided in the top-level scripts directory designed to aid developers working with in-tree builds.
...
zfs.sh: The freshly built kernel modules can be loaded using zfs.sh. This script can latter be used to unload the kernel modules with the -u option.
sudo ./scripts/zfs.sh

@nicedevil007
Copy link
Author

here we go

root@ubuntu:/mnt/zfs-0.8.3# zfs version
zfs-0.8.3-1
zfs-kmod-0.8.3-1

Thank you :D

@gmelikov
Copy link
Member

gmelikov commented Dec 6, 2020

For future googlers:
modprobe load order by default in Ubuntu prefers modules, shipped with kernel.
So, if you want to load newer kmod ZFS module, you may change order of directories to search for modprobe, example for Ubuntu 18.04:

# add 'extra' directory before all
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
depmod
# Now modprobe will see installed kmod files before kernel-shipped ones

@montanaviking
Copy link

I'm running Ubuntu 22.04 and have installed the latest ZFS version (as of Jan 1, 2024) 2.2.2.
The above didn't quite work for me because the zfs version did not match the zfs module version when I followed the link:
https://openzfs.github.io/openzfs-docs/Developer%20Resources/Building%20ZFS.html#
However,
by following the above ZOL link but not the install step, I was able to get a successful installation by:
git clone https://github.com/openzfs/zfs-2.2.2
to your install directory, zfs-2.2.2 as an example.
Then cd to zfs-2.2.2
First install the dependencies:
$ sudo apt install build-essential autoconf automake libtool gawk alien fakeroot dkms libblkid-dev uuid-dev libudev-dev libssl-dev zlib1g-dev libaio-dev libattr1-dev libelf-dev linux-headers-generic python3 python3-dev python3-setuptools python3-cffi libffi-dev python3-packaging git libcurl4-openssl-dev debhelper-compat dh-python po-debconf python3-all-dev python3-sphinx
then build zfs
$ cd zfs-2.2.2
$ sh autogen.sh
$ ./configure
$ make -s -j$(nproc)
DO NOT run the install as listed on the ZOL website which would be:
sudo make install; sudo ldconfig; sudo depmod
If you did do: sudo make install; sudo ldconfig; sudo depmod
then reverse it via: sudo make uninstall; sudo ldconfig; sudo depmod
I believe that the above make instruction will interfere with the proper *.deb installations unless you don't do it or reverse it.
Now you need to build the necessary *.deb packages
$ make deb
The make deb will build the package *.deb array that you need to install.
DO NOT install all of them via dpkg -i *.deb because you need to install dkms first:
$ sudo dpkg -i zfs-dkms_2.2.2-1_amd64.deb
Now proceed with
$ sudo dpkg -i zfs_2.2.2-1_amd64.deb
$ sudo dpkg -i kmod-zfs-5.15.0-91-generic_2.2.2-1_amd64.deb
Note that your kmod-zfs-5.15.0-91-generic_2.2.2-1_amd64.deb will likely have a different kernel number than this example.
Then proceed installing the rest of the *.deb files in your zfs-2.2.2 installation directory as above to install the rest of the *.deb files
EXCEPT DO NOT install the dracut deb: zfs-dracut_2.2.2-1_amd64.deb
I think if you did this by accident you can uninstall it via Synaptic or the command line.
Reboot your machine and check:
$ zfs version
which should report the same zfs and module versions e.g.
zfs-2.2.2-1
zfs-kmod-2.2.2-1

Best of luck. I'm no expert so I don't guarantee the above and you need to experiment yourself on a noncritical machine.

@montanaviking
Copy link

Perhaps, installing the zfs-dkms_2.2.2-1_amd64.deb first might not be the core problem with my first attempt and I suspect excluding the installation (delete or move zfs-dracut_2.2.2-1_amd64.deb) of dracut might work. In that case, one could move or delete zfs-dracut_2.2.2-1_amd64.deb out of the installation directory, (e.g. zfs-2.2.2 but yours might be a different directory),
will then work with
$ sudo dpkg -i *.deb
so long as the zfs-dracut_2.2.2-1_amd64.deb doesn't get installed.
Alternatively, one might be able to remove zfs-dracut after installing zfs-dracut_2.2.2-1_amd64.deb via Synaptic or command line.
I haven't tried this method yet so your mileage might vary.
Best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Issue for discussion
Projects
None yet
Development

No branches or pull requests

5 participants