Upgrade from fedora 41 to fedora42 - root on ZFS

Interesting. I just tested this and it didn’t work the way I expected. However, it did succeed in updating the ZFS packages.

$ sudo zfs-update 
Updating and loading repositories:
 ZFS on Linux for Fedora 42                                                                                                                                                 100% |  21.0 KiB/s |  11.3 KiB |  00m01s
Repositories loaded.
Package                                                                 Arch             Version                                                                  Repository                                    Size
Upgrading:
 libnvpair3                                                             x86_64           2.3.2-1.fc42                                                             zfs                                      101.1 KiB
   replacing libnvpair3                                                 x86_64           2.3.2-1.fc41                                                             zfs                                      105.2 KiB
 libuutil3                                                              x86_64           2.3.2-1.fc42                                                             zfs                                       66.0 KiB
   replacing libuutil3                                                  x86_64           2.3.2-1.fc41                                                             zfs                                       66.2 KiB
 libzfs6                                                                x86_64           2.3.2-1.fc42                                                             zfs                                      603.7 KiB
   replacing libzfs6                                                    x86_64           2.3.2-1.fc41                                                             zfs                                      612.0 KiB
 libzpool6                                                              x86_64           2.3.2-1.fc42                                                             zfs                                        4.1 MiB
   replacing libzpool6                                                  x86_64           2.3.2-1.fc41                                                             zfs                                        4.1 MiB
 zfs                                                                    x86_64           2.3.2-1.fc42                                                             zfs                                        1.9 MiB
   replacing zfs                                                        x86_64           2.3.2-1.fc41                                                             zfs                                        2.0 MiB
 zfs-dkms                                                               noarch           2.3.2-1.fc42                                                             zfs                                       58.7 MiB
   replacing zfs-dkms                                                   noarch           2.3.2-1.fc41                                                             zfs                                       58.6 MiB
 zfs-dracut                                                             noarch           2.3.2-1.fc42                                                             zfs                                       25.4 KiB
   replacing zfs-dracut                                                 noarch           2.3.2-1.fc41                                                             zfs                                       25.4 KiB

Transaction Summary:
 Upgrading:          7 packages
 Replacing:          7 packages

Total size of inbound packages is 33 MiB. Need to download 33 MiB.
After this operation, 54 KiB will be freed (install 65 MiB, remove 65 MiB).
Is this ok [y/N]: y
[1/7] libuutil3-0:2.3.2-1.fc42.x86_64                                                                                                                                       100% | 123.9 KiB/s |  31.3 KiB |  00m00s
[2/7] libnvpair3-0:2.3.2-1.fc42.x86_64                                                                                                                                      100% | 142.1 KiB/s |  38.5 KiB |  00m00s
[3/7] libzfs6-0:2.3.2-1.fc42.x86_64                                                                                                                                         100% | 854.3 KiB/s | 223.8 KiB |  00m00s
[4/7] zfs-0:2.3.2-1.fc42.x86_64                                                                                                                                             100% | 941.2 KiB/s | 751.1 KiB |  00m01s
[5/7] zfs-dracut-0:2.3.2-1.fc42.noarch                                                                                                                                      100% | 153.9 KiB/s |  18.0 KiB |  00m00s
[6/7] libzpool6-0:2.3.2-1.fc42.x86_64                                                                                                                                       100% |   1.9 MiB/s |   1.3 MiB |  00m01s
[7/7] zfs-dkms-0:2.3.2-1.fc42.noarch                                                                                                                                        100% |   4.2 MiB/s |  31.0 MiB |  00m07s
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[7/7] Total                                                                                                                                                                 100% |   4.2 MiB/s |  33.3 MiB |  00m08s
Running transaction
[ 1/16] Verify package files                                                                                                                                                100% |  31.0   B/s |   7.0   B |  00m00s
[ 2/16] Prepare transaction                                                                                                                                                 100% |  38.0   B/s |  14.0   B |  00m00s
[ 3/16] Upgrading libnvpair3-0:2.3.2-1.fc42.x86_64                                                                                                                          100% |  90.9 KiB/s | 101.9 KiB |  00m01s
[ 4/16] Upgrading libuutil3-0:2.3.2-1.fc42.x86_64                                                                                                                           100% |   3.4 MiB/s |  66.9 KiB |  00m00s
[ 5/16] Upgrading libzfs6-0:2.3.2-1.fc42.x86_64                                                                                                                             100% |  14.8 MiB/s | 605.7 KiB |  00m00s
[ 6/16] Upgrading libzpool6-0:2.3.2-1.fc42.x86_64                                                                                                                           100% | 849.4 KiB/s |   4.1 MiB |  00m05s
>>> Running pre-install scriptlet: zfs-dkms-0:2.3.2-1.fc42.noarch                                                                                                                                                   
>>> Finished pre-install scriptlet: zfs-dkms-0:2.3.2-1.fc42.noarch                                                                                                                                                  
>>> Scriptlet output:                                                                                                                                                                                               
>>> Running pre installation script: /var/tmp/rpm-tmp.xMRCv1. Parameters: 2                                                                                                                                         
>>> Removing zfs dkms modules version 2.3.2 from all kernels.                                                                                                                                                       
>>> Module zfs/2.3.2 for kernel 6.13.10-200.fc41.x86_64 (x86_64):                                                                                                                                                   
>>> Before uninstall, this module version was ACTIVE on this kernel.                                                                                                                                                
>>> Deleting /lib/modules/6.13.10-200.fc41.x86_64/extra/zfs.ko.xz                                                                                                                                                   
>>> Deleting /lib/modules/6.13.10-200.fc41.x86_64/extra/spl.ko.xz                                                                                                                                                   
>>> Running depmod.... done.                                                                                                                                                                                        
>>>                                                                                                                                                                                                                 
>>> Deleting module zfs/2.3.2 completely from the DKMS tree.                                                                                                                                                        
>>>                                                                                                                                                                                                                 
[ 7/16] Upgrading zfs-dkms-0:2.3.2-1.fc42.noarch                                                                                                                            100% | 688.6 KiB/s |  59.4 MiB |  01m28s
>>> Running post-install scriptlet: zfs-dkms-0:2.3.2-1.fc42.noarch                                                                                                                                                  
>>> Finished post-install scriptlet: zfs-dkms-0:2.3.2-1.fc42.noarch                                                                                                                                                 
>>> Scriptlet output:                                                                                                                                                                                               
>>> Running post installation script: /var/tmp/rpm-tmp.VrmfJQ. Parameters: 2                                                                                                                                        
>>> Adding zfs dkms modules version 2.3.2 to dkms.                                                                                                                                                                  
>>> Creating symlink /var/lib/dkms/zfs/2.3.2/source -> /usr/src/zfs-2.3.2                                                                                                                                           
>>> Installing zfs dkms modules version 2.3.2 for the current kernel.                                                                                                                                               
>>> Sign command: /lib/modules/6.13.10-200.fc41.x86_64/build/scripts/sign-file                                                                                                                                      
>>> Signing key: /var/lib/dkms/mok.key                                                                                                                                                                              
>>> Public certificate (MOK): /var/lib/dkms/mok.pub                                                                                                                                                                 
>>>                                                                                                                                                                                                                 
>>> Running the pre_build script................ done.                                                                                                                                                              
>>> Building module(s)............... done.                                                                                                                                                                         
>>> Signing module /var/lib/dkms/zfs/2.3.2/build/module/zfs.ko                                                                                                                                                      
>>> Signing module /var/lib/dkms/zfs/2.3.2/build/module/spl.ko                                                                                                                                                      
>>> Running the post_build script... done.                                                                                                                                                                          
>>> Installing /lib/modules/6.13.10-200.fc41.x86_64/extra/zfs.ko.xz                                                                                                                                                 
>>> Installing /lib/modules/6.13.10-200.fc41.x86_64/extra/spl.ko.xz                                                                                                                                                 
>>> Running depmod.... done.                                                                                                                                                                                        
>>>                                                                                                                                                                                                                 
[ 8/16] Upgrading zfs-0:2.3.2-1.fc42.x86_64                                                                                                                                 100% |  13.5 MiB/s |   2.0 MiB |  00m00s
[ 9/16] Upgrading zfs-dracut-0:2.3.2-1.fc42.noarch                                                                                                                          100% |   5.5 MiB/s |  28.4 KiB |  00m00s
[10/16] Removing zfs-dracut-0:2.3.2-1.fc41.noarch                                                                                                                           100% | 900.0   B/s |  18.0   B |  00m00s
[11/16] Removing zfs-0:2.3.2-1.fc41.x86_64                                                                                                                                  100% |   9.7 KiB/s | 356.0   B |  00m00s
>>> Running pre-uninstall scriptlet: zfs-dkms-0:2.3.2-1.fc41.noarch                                                                                                                                                 
>>> Finished pre-uninstall scriptlet: zfs-dkms-0:2.3.2-1.fc41.noarch                                                                                                                                                
>>> Scriptlet output:                                                                                                                                                                                               
>>> Running pre uninstall script: /var/tmp/rpm-tmp.ZzQaLS. Parameters: 1                                                                                                                                            
>>> This is an upgrade. Skipping pre uninstall action.                                                                                                                                                              
>>>                                                                                                                                                                                                                 
[12/16] Removing zfs-dkms-0:2.3.2-1.fc41.noarch                                                                                                                             100% | 134.6 KiB/s |   4.2 KiB |  00m00s
[13/16] Removing libzfs6-0:2.3.2-1.fc41.x86_64                                                                                                                              100% |   3.2 KiB/s |  13.0   B |  00m00s
[14/16] Removing libzpool6-0:2.3.2-1.fc41.x86_64                                                                                                                            100% |   1.6 KiB/s |   5.0   B |  00m00s
[15/16] Removing libnvpair3-0:2.3.2-1.fc41.x86_64                                                                                                                           100% |   2.4 KiB/s |   5.0   B |  00m00s
[16/16] Removing libuutil3-0:2.3.2-1.fc41.x86_64                                                                                                       100% [==================] |   2.0 KiB/s |   5.0   B |  00m00s
>>> Running trigger-post-uninstall scriptlet: filesystem-0:3.18-36.fc42.x86_64                                                                                                                                      [16/16] Removing libuutil3-0:2.3.2-1.fc41.x86_64                                                                                                                            100% |   0.0   B/s |   5.0   B |  00m06s
Complete!

I think it worked because, although the RPM archive filename changed, the actual GPG key is the same. I might need to revise my script a bit to be sure the key is updated. Thanks for letting me know about this potential problem!

Thanks so much, this was exactly what was bugging me. I didn’t even know there is a non-offline method of upgrading to 42.

It’s good we get clarity for this. Interesting to see what you come up with!

1 Like

I’ve pushed an updated version of the zfs-update script to the test branch of my repo. If you haven’t already updated, go ahead and give it a try and let me know if you find any problems. Thanks for reporting this. :slightly_smiling_face:

I will, but it will take some time. This is my main system, and i have about 2 billion running applications and windows, unsaved documents etc.. And it’s friday evening.

This requires multiple reboots as i first reboot and take snaphots of / and /home in zfsbootmenu of the current state, then upgrade to final version of fedora 41 (and also do zfs-update and kernel-update), then reboot and take another snapshot before finally upgrading to 42 using the official offline method from fedora guide.

I prefer the offline method since the download is about 3GB iirc, and it prevents the upgrade from being disrupted by potential network disruptions or powerouts (i’ve had those)

But i’ll definitely test when i get the chance, Thank you so much.

1 Like

Just FYI, the “online” method also does a full download of all the packages (and a transaction check) before it starts the install process. It isn’t really any different from the “offline” method except the the offline method forces you to shut down most of your processes before it runs. You can manually stop most of your processes by switching to the “multi-user” systemd target first and then the online method has the benefit that you can (potentially) recover from an installation process that might fail part way through. Either way should work, but I only test the online update method.

So it seems to work ok. I tested this on a VM that is basically a clone of my main system in terms of ZFS on root configuration, and encrypted /home unlocking mechanism.

First i updated f41 to latest using the standard dnf, zfs-update and kernel-update scripts i installed from your repo some months ago.

then reboot and snapshot before_f42_upgrade, then i updated all scripts from you test repo:

cd /usr/local/bin/ && \
rm -f * && \
wget https://raw.githubusercontent.com/gregory-lee-bartholomew/fedora-on-zfs/refs/heads/test/supplements/dnf && \
wget https://raw.githubusercontent.com/gregory-lee-bartholomew/fedora-on-zfs/refs/heads/test/supplements/kernel-update && \
wget https://raw.githubusercontent.com/gregory-lee-bartholomew/fedora-on-zfs/refs/heads/test/supplements/zfs-update && \
chmod +x *

ran dnf up --refresh, zfs-update and kernel-update again just to be sure, everything normal, nothing to do.

then the following commands:

dnf system-upgrade download --releasever=42
dnf5 offline reboot
dnf install remove-retired-packages -y && \
remove-retired-packages 41
dnf install rpmconf -y  && \
rpmconf -a
dnf repoquery --duplicates
dnf list --extras
dnf distro-sync --allowerasing

And all is well.

I would like to maybe adopt the non-offline method of upgrading, and also include the --allowerasing switch. Am i correct to assume that command dnf distro-sync --allowerasing
at the end of that list is the same as doing the upgrade including that switch?

Anyways, all 3 scripts in test repo seem fine when doing the offline upgrade. Thanks for your work and help :slight_smile:

Eh, unfortunately, dnf distro-sync is yet another update strategy that is quite different from dnf upgrade. There has been some discussion about the difference on this forum before:

I always use (and recommend) dnf upgrade. The wrapper script, as I’ve written it, will only exclude the kernel and zfs packages from the transaction if you use one of the equivalent aliases – update, upgrade, or up.

Any switches you pass to the dnf wrapper script such as --refresh or --allowerasing should get forwarded on to the real dnf command. The wrapper script should not modify any --... options that you supply.

Glad it worked anyway. Thankfully, Fedora’s update system is quite robust and usually does the right thing (or cancels the operation if it cannot be done).

1 Like

Hello again, i see you’ve made a change to zfs-update 11 hours ago :slight_smile:

Getting ready to upgrade my main system and i’m wondering if i should first install your scripts from test repo, or if you are planning to move the updates to main?

Maybe it’s soon time to create a .rpm file. as your tools are basically essential for root on ZFS systems :wink:

cheers

The changes I made were to add some tests to give the user better feedback about potential error conditions and to use rpm -U ./zfs-release.rpm instead of dnf -y install ./zfs-release.rpm because the former generates less “line noise”. I’ve tested it a few times on a couple of my systems and I think it is ready to go to the main branch. I just haven’t got to it yet.

It should work. Go ahead and try it out. Thanks! :slightly_smiling_face:

Already did, works just fine. Thank you again.

1 Like

Hello again.. Fedora forums just alerted me to this interesting comment from @anthonywbarone

So i wanted to ask, might this mitigate the need for your supplemental dnf wrapper scripts?
Or are you maybe involved in this earth-shattering development? :slight_smile:

Thanks

There is a 3rd option for upgrading to a new Fedora release (e.g., 41–>42) with zfs on root. Its a bit more work, but llets you do an offline update and stay in control during the update process.

First, create and then boot a Fedora 42 live usb.

In the live OS, set up tmpfs overlays on /usr and /var (so that installing zfs doesnt use up the little free space in the live system). start with running sudo su, then run

for nn in usr var; do
  mkdir -p /overlay/${nn}
  mount -t tmpfs tmpfs /overlay/${nn}
  mkdir -p /overlay/${nn}/{upper,work}
  mount -t overlay -o rw,upperdir=/overlay/${nn}/upper,workdir=/overlay/${nn}/work,lowerdir=/${nn} overlay:${nn} /${nn}
done

Next get kernel-devel installed. if you use one of the live respins you might be able to get this from dnf, but in general you can grab the kernel-devel for whatever kernel the live system is using from koji.

next install zfs

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

next get the zfs dataset mounted at /sysroot

modprobe zfs
zpool import -f -R /sysroot POOL_NAME

You can now implement an “offline” update of your system using the “online” dnf commands - just add --installroot=/sysroot --releasever=42 to the dnf commands. e.g., to update everything do

dnf distro-sync --installroot=/sysroot --releasever=42 -y

before you reboot, remember to run

zpool export POOL_NAME

This allows you to update the system offline but (unlike the typical offline update method) allows you to manually tweak things / run scripts as needed before/during/after the update. And, should something in the update fail, this allows you to interactively respond to any errors and fix things with the system still offline instead of having to try to boot into a half updated system).

This is great, but imo uneccesary and very complicated. What i do is simply upgrade f41 to latest, reboot and use zfsbootmenu to create a full snapshot:

zroot/ROOT/fedora@2025-05-04-101849_b4_f42_upgrade

and then do the offline upgrade to f42. If it fails, i’ll just rollback to f41, and come here to cry about it :slight_smile:

But my offline upgrade of zfs on root went flawless.

It might. It will certainly help. Personally, I intend to continue using the wrapper, but it is completely up to you whether you prefer to update your system and the kernel with ZFS in separate steps. The dnf wrapper script just excludes the zfs and kernel rpms from the sudo dnf update operation and expects that you will update those with separate runs of zfs-update and kernel-update. The latter provides a handy link where you can check to see if your currently-installed version of ZFS is compatible with the to-be-installed kernel before you attempt the update.

It’s totally up to you in any case.

Nope. I wasn’t involved. It’s a good improvement to see for Fedora Linux users though.

I’m just a end-user with no knowledge of scripting or coding, but i really feel like the current way of trying to implement a resilient and reliable OS using something like DNF, however good it is, will never succeed. Because even if the devs of dnf are super-human, they will never be able to foresee each and every scenario, and account for it.

I believe the choice of btrfs as the standard FS for fedora is a big mistake.

I believe Fedora should choose the best FS as their standard FS. The best FS in the world today is ZFS.

The zfs on linux project and team is what someone on the internet called ‘a magical filesystem’

I believe that DNF should be implemented with zfs, and work on an atomic level in regards to the underlying block device, and just add or remove bits as necessary, instead of trying to implement and maintain highly complicated scripts to add or remove those bits, which can never be 100% successful in any scenario.

Each operation DNF does should start and end with a snapshot, that can be destroyed or replicated as necessary. If a user does ‘dnf install nano zsh’, then after that operation, either dnf remove nano or dnf remove zsh should simply remove the bits written to the block device by that command, leaving everything else as is, minus the potential dependencies.

I also believe this system should implement the zfs redaction bookmark feature:

This feature can be used to allow clones of a filesystem to be made available on a remote system, in the case where their parent need not (or needs to not) be usable. For example, if a filesystem contains sensitive data, and it has clones where that sensitive data has been secured or replaced with dummy data, redacted sends can be used to replicate the secured data without replicating the original sensitive data, while still sharing all possible blocks. A snapshot that has been redacted with respect to a set of snapshots will contain all blocks referenced by at least one snapshot in the set, but will contain none of the blocks referenced by none of the snapshots in the set. In other words, if all snapshots in the set have modified a given block in the parent, that block will not be sent; but if one or more snapshots have not modified a block in the parent, they will still reference the parent’s block, so that block will be sent. Note that only user data will be redacted.

I believe the current established way of managing a linux distro using complicated scripts and dependencies that try to take into consideration every user scenarion of every system in the world, is an excercise in futility. Instead, anything the user needs done on their Fedora OS should be but one mouseclick away with a 100% successrate. Only ZFS makes that a possibility.

Just my .2 cents

It won’t happen as long as ZFS isn’t integrated with the Linux kernel. Linus will not include ZFS in the Linux kernel for legal reasons.

Excerpt from https://itsfoss.com/what-is-zfs/:

Yes i’m well aware of these ‘issues’ but i won’t get into this, other than i speak the same minority language as Linus (about 300K people in the world) and i’ll just say he’s no authority that people should listen to in this regard, and use that as an excuse not to even try.

I say disregard his opinion and fear or Oracle, and do it anyways. Be a rebel.

That’s a lot easier to say when it isn’t your money on the line. Red Hat / IBM are very big companies with a lot of financial wealth to be concerned about.

Yes, but they are not bigger than the world. The licencing issues are a grayzone, that the majority can vote to disregard without consequences if they want to. The other option is that a small elite of lawyers condems every linux user into a soviet style goulag to die.

It’s time to have some courage

also, it’s not theft, because the code is already out there. They released it themselves.

See no Evil, Hear no evil, Speak no evil.