Skip kernel module at boot

12

3

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?

Gris

Posted 2010-06-17T16:41:03.557

Reputation: 123

related https://askubuntu.com/questions/110341/how-to-blacklist-kernel-modules

– Ciro Santilli 新疆改造中心法轮功六四事件 – 2017-12-30T22:49:23.697

Answers

1

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=off forces 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:

  • nousb disables kernel USB support
  • cgroup_disable=[name] disables a particular controller; however, "memory" is the only example specifically supported
  • libata.noacpi disables ACPI use in libata (SATA controllers); this is an example of passing a module parameter via the kernel

quack quixote

Posted 2010-06-17T16:41:03.557

Reputation: 37 382

7

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

modprobe.blacklist=modname1,modname2,modname3

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.

$module_name.blacklist=yes

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.

Anton Samsonov

Posted 2010-06-17T16:41:03.557

Reputation: 191

I have the same question on why "$module_name.blacklist=yes" works, and I think it is related to this part of kernel code: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/kernel/params.c?h=v3.2.96#n786

– Johnlcf – 2017-11-30T02:37:00.070

1

You should be able to either add it to /etc/modprobe.d/blacklist, or blacklist 'modulename'

Gnostus

Posted 2010-06-17T16:41:03.557

Reputation:

this will work but requires booting to another kernel (if available) or a LiveCD system. – quack quixote – 2010-06-17T17:41:36.563