Upgrade from fedora 41 to fedora42 - root on ZFS

Hello all, greetings!

I am running fedora41 with root on ZFS and ofcourse, I still can not upgrade because zfs doesnt support kernelk 6.14, yet !

However, can I try to upgrade running this command?

sudo dnf distro-sync --releasever=42 --allowerasing --exclude=kernel --exclude=kernel-core --exclude=kernel-devel --exclude=zfs-fuse

Actually no, because dnf will remove my zfs modules:

❯ sudo dnf distro-sync --releasever=42 --allowerasing --exclude=kernel --exclude=kernel-core --exclude=kernel-devel --exclude=zfs-fuse
Updating and loading repositories:
 ZFS on Linux for Fedora 42                                                               100% |   1.4 KiB/s |   1.4 KiB |  00m01s
>>> Status code: 404 for http://download.zfsonlinux.org/fedora/42/x86_64/repodata/repomd.xml (IP: 52.92.241.27) - http://download.
>>> Status code: 404 for http://download.zfsonlinux.org/fedora/42/x86_64/repodata/repomd.xml (IP: 52.92.241.27) - http://download.
>>> Status code: 404 for http://download.zfsonlinux.org/fedora/42/x86_64/repodata/repomd.xml (IP: 52.92.241.27) - http://download.
>>> Status code: 404 for http://download.zfsonlinux.org/fedora/42/x86_64/repodata/repomd.xml (IP: 52.92.241.27) - http://download.
>>> Librepo error: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried                        
Repositories loaded.
Package                                                  Arch   Version                                Repository             Size
Removing dependent packages:
 akmod-nvidia                                            x86_64 3:570.133.07-1.fc41                    rpmfusion-nonfree  92.2 KiB
 akmods                                                  noarch 0.6.0-8.fc41                           updates            64.2 KiB
 dkms                                                    noarch 3.1.7-2.fc41                           updates           202.0 KiB
 kernel-devel-matched                                    x86_64 6.13.11-200.fc41                       updates             0.0   B
 libvirt                                                 x86_64 10.6.0-7.fc41                          updates             0.0   B
 libvirt-daemon-driver-storage                           x86_64 10.6.0-7.fc41                          updates             0.0   B
 libvirt-daemon-driver-storage-zfs                       x86_64 10.6.0-7.fc41                          updates            23.8 KiB
 libvirt-daemon-kvm                                      x86_64 10.6.0-7.fc41                          updates             0.0   B
 zfs                                                     x86_64 2.3.1-1.fc41                           zfs                 2.0 MiB
 zfs-dkms                                                noarch 2.3.1-1.fc41                           zfs                57.5 MiB
 zfs-dracut                                              noarch 2.3.1-1.fc41                           zfs                25.4 KiB

Any other way to keep my zfs intact?
Thanks

Don’t upgrade until a compatible zfs version becomes available.

1 Like

Actually, dnf upgrade doesnt remove zfs:

sudo dnf upgrade --releasever=42 --allowerasing --exclude=kernel --exclude=kernel-core --exclude=kernel-devel --exclude=zfs-fuse

1 Like

I always use dnf upgrade --releasever=<N> to upgrade to the next release. I also have a “wrapper” script for dnf saved under /usr/local/bin that always adds --exclude=kernel\* to dnf update (or dnf upgrade) and then I always update the kernel separately from everything else whenever a compatible update comes along.

The wrapper scripts I use are here: fedora-on-zfs/supplements at main ¡ gregory-lee-bartholomew/fedora-on-zfs ¡ GitHub

3 Likes

Thank you, great tool.

So, I put your dnf wrapper under /usr/local/bin and ran:

sudo dnf upgrade --releasever=42

and it gives me :

Transaction Summary:
 Installing:        43 packages
 Upgrading:       2314 packages
 Replacing:       2321 packages

So, am I safe to upgrade? :slight_smile:

Yes. It should report at the end that the kernel and zfs updates were excluded. There are two separate scripts that I run when I want to update zfs or the kernel (zfs-update and kernel-update).

Glad you found it useful. :slightly_smiling_face:

P.S. Don’t try to use any of the other scripts from that supplements subdirectory (the ones named os??). Those are written for the specific configuration that the main Fedora-on-ZFS script creates and they might damage a system that was installed by some other means. (They should bail out early with an error message, but those scripts are quite new and not well tested.)

cool, already running the upgrade.
now I see lot of yellow lines like
/etc/selinux/targeted…bla bla
over and over, clearly is doing something

Yeah, the “normal” offline updater that Fedora Linux uses will cover all those messages up with a dancing hot dog or whatever you have your Plymouth animation set to. When you use dnf update ... you will see all the gory details of what is going on. Personally, I prefer to see the error messages and warnings so I have the opportunity to correct them. I guess most people find them “scary” though, so Fedora Linux hides all that by default.

BTW, when you do an online update like that, you should shutdown all your running programs and run sudo systemctl isolate multi-user.target first. You’ll normally get away without doing that though.

aaaand, voila!
done!

1 Like

The next thing you should run is sudo rpmconf -a. Then reboot after you have confirmed that all the configuration files have been updated the way you want.

You can skip sudo rpmconf -a. You just might miss out on some updated settings in rare cases (especially if you customized anything under /etc).

interesting, rpmconf not found

It looks like there is something unusual happening with your SELinux rules. You might want have a look at the output of sudo semanage -o and sudo semodule --list=full | grep -v '^100'. If there are old customizations there that you no longer need, you might remove them.

You might also want to run sudo fixfiles -F onboot once and reboot to have your system relabel all your files and be sure they have the right contexts.

Yeah, rpmconf isn’t installed by default. I guess they figure most people don’t customize any of their global settings? :person_shrugging:

BOOM!
Restarted. Fedora 42 (Adams)

1 Like

Thank you for your help!

1 Like

I use your excellent scripts, they complement my root on ZFS install perfectly, even though i don’t use your install script as it requires two drives. But thank you for your scripts.

Regarding upgrading a root on ZFS fedora 41 to 42, it seems the packages are now available:
https://github.com/zfsonlinux/zfsonlinux.github.com/tree/master/fedora

But i was wondering, what is the correct sequence to do the upgrade, install that .rpm first, then do the ‘dnf upgrade --releasever=’, or the other way around, using your scripts to exclude kernel and ZFS from 42 upgrade, then either run update-zfs and update-kernel, or install that .rpm?

Sorry i’m new to DNF5 so i’m not clear about this..

edit sorry, reply was meant to @glb

Hi @unused-hardhat:

You don’t need to download and install that RPM separately. It will happen when you run sudo zfs-update.

You should update the rest of the OS first with the sudo dnf upgrade --releasever=... command. Then, when you run sudo zfs-update, it should automatically fetch and install that RPM containing the new GPG keys from the ZFS repo.

Finally, you can run the sudo kernel-update script to install the latest kernel with the new ZFS driver.

Thank you, but just to be clear, since the 42 upgrade is done after reboot into systemd, i should definitely do the zfs-update before allowing the reboot after downloading the 42 files, but before doing the ‘dnf5 offline reboot’ command?

Or does your zfs-update scripts also prevent kernel and zfs from being upgraded in this case?

As per the guide, the upgrade is done with the commands

dnf system-upgrade download --releasever=42
dnf5 offline reboot

I never use the offline upgrade method. That would likely bypass the wrapper script I have that excludes the kernel. My guess is that it would try to install the new kernel without the updated ZFS driver and that would likely fail. Hopefully it would just fail to update the kernel, but the rest of the OS would be upgraded. In that case, you would just need to follow-up with the zfs-update and kernel-update commands to finish updating your kernel.

You can run the updated OS on the previous version’s kernel for a while. It is not a problem to update the OS without updating the kernel (at least for a while).