`dracut-install: ERROR: installing 'lz4_compress'`

I’ve followed these wiki instructions for configuring Zswap. However, I run into the following error when regenerating initramfs with dracut:

dracut: FAILED:  /usr/lib/dracut/dracut-install -D /var/tmp/dracut/initramfs --kerneldir /lib/modules/5.6.19-300.fc32.x86_64/ -m lz4 lz4_compress
dracut-install: ERROR: installing 'lz4_compress'

Any ideas?

sudo modprobe lz4 lz4_compress runs to completion without error, so the kernel modules are installed and available.

Hi noda

Kernel modules are called drivers by dracut. “dracut modules” are essentially what are found under /usr/lib/dracut/modules.d. You need to pass -d, not -m to dracut for kernel drivers (elsewhere known as kernel modules).

1 Like

This is correct for dracut. However, the -m argument is passed to dracut-install and there it means kernel module.

The above is generated by the dracut.conf using add_drivers (as opposed to add_modules).

1 Like

My mistake. I didn’t examine the error message you provided closely enough.

My only guesses then are that the module isn’t available in the version of the kernel you are trying to install (unlikely, but you might try something like “find /lib/modules/5.6.19-300.fc32.x86_64 -name ‘lz4*’” to be sure). Or maybe that the module name isn’t being passed right. I’ve seen the latter occur when, e.g., add_drivers+=“zfs” is used in one config file and add_drivers+=“nfs” is in another config file. Dracut ends up trying to add “nfszfs” to the initramfs which, of course, doesn’t exist. If you look closely at the documentation, you will see that there are supposed to be spaces between the quotes and the module name (i.e. add_drivers+=" zfs “). That leads to another idea though. Are there supposed to be multiple -m flags? What if you specified add_drivers+=” lz4 " and add_drivers+=" lz4_compress " as separate line items?

That’s all I know. Sorry.

The Wiki page changed, it now references modules lz4hc and lz4hc_compress.

I got the same dracut-install error on my machine after a kernel upgrade. I followed the updated instructions and changed the dracut configuration line to add_drivers+=" lz4hc lz4hc_compress ", then dracut --regenerate-all --force succeeded.

I still don’t know why lz4_compress doesn’t work, but I noticed that lsmod doesn’t list it.

$ sudo modprobe lz4 lz4_compress
$ sudo modprobe lz4hc lz4hc_compress
$ smod | grep lz4
lz4                    16384  0
lz4hc                  16384  8
lz4hc_compress         24576  1 lz4hc
1 Like

I don’t think you need lz4_compress anymore. For some reason, only the lz4hc has a companion _compress module compiled now.

I had no issues using zswap.compressor=lz4 without lz4_compress being installed by dracut. I assume this functionality was combined into the singular lz4 module.

lz4hc and lz4hc are different compression algorithms from lz4 in that the hc stands for “high compression,” but in the context of zswap and RAM, the added slowness may not be desirable over lz4

In short, I think the wiki and other sources are recommending lz4hc and lz4hc_compress not because that’s what you should be using, but because it’s what they figured they could add to the initramfs without error. Just use lz4