Blacklist modules on Ubuntu

By default the kernel loads some modules which may not be required by your laptop/computer. I have disabled all the modules on Ubuntu 12.04 other than those related to sound, network and graphics to speed-up boot time. To stop modules from loading add them in the /etc/modprobe.d/blacklist.conf file. Here goes my configuration. Several modules can be specific to your hardware. For example, I keep the laptop webcam disabled.

$ cat /etc/modprobe.d/blacklist.conf
...
#apj added
blacklist btusb
blacklist joydev
blacklist bluetooth
blacklist rfcomm
blacklist bnep
blacklist uvcvideo
blacklist videodev
blacklist v4l_compat_ioctl32
blacklist lp
blacklist parport
blacklist btrfs
blacklist ufs
blacklist qnx4
blacklist hfsplus
blacklist hfs
blacklist minix
blacklist vfat
blacklist msdos
blacklist jfs
blacklist xfs
blacklist reiserfs
blacklist ext2
blacklist zlib_deflate
blacklist libcrc32c
$
  • To disable the printer modules lp and parport, blacklisting lp is not enough. Comment (#) out the entry for lp in /etc/modules file.
  • To disable IPv6 add the following to GRUB_CMDLINE_LINUX_DEFAULT as a kernel boot parameter to /etc/default/grub (as root):
    ipv6.disable=1

    OR add the following in sysctl.conf

    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1

    and run

    $ sudo sysctl -p
  • At any time, to find out more about a module try the following (or Google the module name):
    $ modprobe modulename

4 thoughts on “Blacklist modules on Ubuntu”

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s