There is a broken kernel module, due to which I can not even load the OS, so I can not delete or fix it. Is it possible to skip this module at boot, using the kernel's parameters or something?
related askubuntu.com/questions/110341/how-to-blacklist-kernel-modules– Ciro Santilli OurBigBook.comDec 30, 2017 at 22:49
Blacklisting the module as mentioned in the previous answer is the best way to completely avoid a kernel module. Aside from blacklisting, there is no generic way to disable a module.
Some Linux distributions do provide kernel boot parameters to do things like this.
- In Arch Linux,
load_modules=offforces udev to skip auto-loading. This would allow you to boot without loading modules, blacklist a module that's causing trouble, and reboot normally without the troubled module loading.
- Knoppix has a long list of extra boot parameters (aka "cheatcodes"); these are a mix of normal kernel boot parameters and Knoppix-specific extras.
For further info, see the Kernel Parameters documentation. There are parameters for disabling specific subsystems. For example:
nousbdisables kernel USB support
cgroup_disable=[name]disables a particular controller; however, "memory" is the only example specifically supported
libata.noacpidisables ACPI use in libata (SATA controllers); this is an example of passing a module parameter via the kernel
Disabling specific modules is possible from boot loader, but looks like distro-dependent indeed.
On one hand, Linux Kernel Parameters documentations states, as of August 2016:
module_blacklist=[KNL] Do not load a comma-separated list of modules. Useful for debugging problem modules.
On the other hand, the option that worked for me with openSUSE 42.1 (Linux 4.1.31) is described in Arch Kernel modules wiki:
You can also blacklist modules from the bootloader. Simply add
to your bootloader's kernel line, as described in Kernel parameters. When you are blacklisting more than one module, note that they are separated by commas only. Spaces or anything else might presumably break the syntax.
(Thanks to @gertvdijk at unix.SE for pointing this out.)
Also worth to mention is the following method:
In order the prevent certain modules from being loaded by the kernel using the grub command line you need to pass them as a parameter to the kernel line using the below syntax.
I have no idea where did they get that from, but it will definitely not hurt to try any other method if all else fails.
I have the same question on why "$module_name.blacklist=yes" works, and I think it is related to this part of kernel code: git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/…– JohnlcfNov 30, 2017 at 2:37
You should be able to either add it to /etc/modprobe.d/blacklist, or blacklist 'modulename'
1this will work but requires booting to another kernel (if available) or a LiveCD system. Jun 17, 2010 at 17:41
For Ubuntu, you can press Escape or Shift at boot which will bring you to the grub menu.
There, choose advanced options, pick your kernel and then "drop to root prompt".
You can blacklist your module by putting it in
Ctrl+D to go back into the grub menu once you're done.
"Resume" to resume the boot process.
Unfortunately for me the kernel already crashes when dropping to root prompt, so I need a way to disable the bad module (iwlwifi) from grub. Oct 19, 2022 at 6:28
At Grub 2, I was adding (typing in) a command
to blacklist radeon graphics module/driver which did not work on my laptop, and it worked.
(Press Tab when GRUB 2 menu appears to add parameters.)
(Do not forget a space before modprobe.blacklist!)
(Details: I was booting from Live USB to install Linux Mint, but this is not very important here.)