How to disable ZFS kernel-module before boot in grub?
It is mentioned that some modules can be disabled through grub command line in similar question. Unfortunately this method is not working with zfs:
module_to_blacklist.blacklist=yes
With next message: unknown parameter 'blacklist' ignored
If I'm correct that you installed ZFS via dkms then it looks like you need to remove it via the same tool.
dkms remove [module/module-version] [-k kernel/arch] [--all]
Source: http://manpages.ubuntu.com/manpages/trusty/man8/dkms.8.html
Note: You might wish to avoid using the --all option until you are certain that you have obtained the desired results.
I'm running into this issue because I want to boot a recent Ubuntu Live CD such that the kernel is not tainted. However the ZFS modules taint the kernel.
TLDR; Booting with the kernel parameter
systemd.mask=zfs.target
allowed booting without loading the zfs modules automatically.In investigating this I found 3 places where the zfs module could get loaded.
/scripts/zfs
tries to load the module in load_module_initrd, but this only gets called if there is a kernel parameterboot=zfs
/etc/init.d/zfs-import
will load the module when started, but this init script is by default only started at run levelsS
(single user mode), so not normally.zfs.target
, which is started by themulti-user.target
, will load the modules via thezfs-load-module.service
. This can be disabled with the kernel boot parametersystemd.mask=zfs.target