3

After configuring zswap and running (for enabling lz4 compression in zswap on the initramfs stage):

sudo -s
echo lz4 >> /etc/initramfs-tools/modules
echo lz4_compress >> /etc/initramfs-tools/modules
update-initramfs -u

and

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash init=/bin/e4rat-lite-preload zswap.enabled=1 zswap.compressor=lz4"

in grub(and running update-grub)

the output of dmesg | grep -i zswap is

[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.10.0-19-
generic.efi.signed root=UUID=9d2dfe9c-48af-4577-bfd0-fb484fa9aed5 
ro quiet splash init=/bin/e4rat-lite-preload zswap.enabled=1 
zswap.compressor=lz4 vt.handoff=7
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-
4.10.0-19-generic.efi.signed root=UUID=9d2dfe9c-48af-4577-bfd0-
fb484fa9aed5 ro quiet splash init=/bin/e4rat-lite-preload 
zswap.enabled=1 zswap.compressor=lz4 vt.handoff=7
[    0.971264] zswap: compressor lz4 not available, using default 
lzo
[    0.971286] zswap: loaded using pool lzo/zbud

How can I enable lz4?

1

1 Answer 1

2

I think for some reason the module should be loaded before generating the initramfs.

Try the following, worked for me on Ubuntu 16.04.

sudo modprobe -v lz4
sudo update-initramfs -u 
sudo reboot
0

You must log in to answer this question.