Dracut changed default behavior after update; how to fix?

I have a system with zfs filesystem support, I have both linux and linux-lts installed. When the linux kernel is too new for zfs, I switch over to linux-lts until the zfs module has caught up and supports the linux kernel as well.

System boot-manager is grub.

Before the last dracut update, the standard behavior was that building the zfs module failed, but dracut went on to build the initramfs, just without the zfs module.

When this happened, I could just use sudo grub-set-default 0 to switch to linux-lts and reboot to have zfs active. After zfs got upgraded, I did sudo grub-set-default 2 to switch back to the linux kernel.

This has worked without issues for a long time.

Now, after an update, failure to build the zfs module means that dracut fails to build the initramfs and the fallback initramfs. There’s no initramfs for the linux kernel and unsupported zfs after running dracut.

This leads to an unbootable system after the reboot because no initramfs is found.

Trying to get around this with grub-set-default fails as well, it seems that when the initramfs is missing, the grub mechanism gets confused and keeps whatever was set as default before - the unbootable linux kernel.

How can I fix this mess?

dracut hasn’t updated in a couple of months so I am not sure why this would have changed. Is it possible that the issue is that situation is returning a different code than it did in the past?

That being said, the easy way to solve this problem is to use the arch zfs repo. That will block you from getting kernel updates prior to the modules being ready.

Most likely, if dracut hasn’t gotten an update, it must be a different code returned. How and where this interaction happens is mysterious to me.

Probably best to go the easy way, since finding out what happened and to fix it seems to be way more trouble than it’s worth.

1 Like

I have been using the arch zfs repo for years. It is basically painless. Updates just work and you don’t need to worry about it.

The only downside is that you can’t support custom or special kernels this way.