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.

  • Did you previously mount and unmount a JFS filesystem? That would cause the module to be loaded but not currently used. – Michael Hampton Dec 13 '17 at 17:59
  • No... Also most certainly haven't used btrfs, ntfs and the like either -- and all are loaded. – Mikhail T. Dec 13 '17 at 22:31
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)

  • 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 9: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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.