4

Our Ubuntu-servers all seem to have various unused kernel-modules loaded wasting RAM and, in the case of jfs for example, running a bunch of useless processes (jfsCommit).

I can use rmmod to get rid of them at runtime, but I wonder, what causes them to load in the first place.

Ideally, I'd be able to remove the module-binaries too.

Mikhail T.
  • 2,272
  • 1
  • 22
  • 49

1 Answers1

3

If the modules in question are built into the kernel, the only way is recompiling the kernel.

If they are separate modules, you can blacklist them.

Add

blacklist module_name

to the file

/etc/modprobe.d/blacklist.conf

(needs restart)

alinepegas
  • 46
  • 5
  • Thanks. But what causes these to be loaded in the first place? Or is _everything_ available, that's not explicitly blacklisted loaded at boot? – Mikhail T. Dec 13 '17 at 22:35
  • The kernel loads the modules according to what is in the subdirectories of /lib/modules. But it's not advisable to delete files there, it tends to get messy. – alinepegas Dec 14 '17 at 09:34
  • So, _everything_ under `/lib/modules` is loaded which is not explicitly blacklisted? – Mikhail T. Dec 15 '17 at 12:03
  • 1
    Not everything. Modprobe will load the ones whose dependencies are on /lib/modules/$(uname - r)/modules.dep and the corresponding binaries are on /lib/modules/$(uname - r)/modules.dep.bin – alinepegas Dec 15 '17 at 12:15