10

I'm trying to figure out how to blacklist modules, and I'm trying it on the USB storage. Unfortunately it seems to have no effect, and I get the module in even if it's not used (apparently).

My experiment is taking place on an Ubuntu 12.04.3 LTS.

raptor@raptor-VirtualBox:/etc/modprobe.d$ lsmod | grep usb
usb_storage            39720  0 
usbhid                 46054  0 
hid                    82511  2 hid_generic,usbhid
raptor@raptor-VirtualBox:/etc/modprobe.d$ cat blacklist.conf | grep usb
blacklist usb_storage
blacklist usbmouse
blacklist usbkbd
14

Your problem probably results from the fact that a copy of /etc/modprobe.d/blacklist.conf is located in the initramfs. When you reboot your computer, it is still using the old copy that doesn't contain your change. Try to rebuild the initramfs with the following command and then reboot:

sudo update-initramfs -u
| improve this answer | |
  • Worked like charm – Sergiy Kolodyazhnyy Mar 21 '19 at 4:40
  • Yup. That did it. – clearlight Aug 12 '19 at 2:42
  • Thank you! This saves me a lot of frustration! – pepoluan Feb 28 at 5:23
0

If update-initframfs doesn't exist, look for /bin/kernel-install. If that exists, you'll need to use that. On my Fedora system I did rpm -q --scripts kernel-core to find the post transaction (posttrans) scriptlet and ran it manually:

/bin/kernel-install add 5.5.5-200.fc31.x86_64 /lib/modules/5.5.5-200.fc31.x86_64/vmlinuz
| improve this answer | |
0

For system based on RHEL (suse/opensuse/etc.) to update the initramfs the command is

mkinitrd
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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