LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-31-2013, 07:27 PM   #1
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Rep: Reputation: 27
Unload kernel module at boot time (Debian Wheezy 7.2, 3.2.0-4-686-pae kernel)


Hi everyone,
I am trying to prevent the ehci_hcd kernel module to load at boot time.
Here's what I've tried so far:
1) Add the following line to /etc/modprobe.d/blacklist.conf (as suggested here):
Code:
blacklist ehci_hcd
2) Blacklisted the module by adding the following string to
Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet modprobe.blacklist=ehci_hcd"
3) Tried to blacklist the module by adding the following line to /etc/modprobe.d/blacklist (without the .conf):
Code:
blacklist ehci_hcd
After trying each step I updated the boot image with
Code:
dpkg-reconfigure linux-image-$(uname -r)
and rebooted, each time to no use.
I've also removed the module with
Code:
modprobe -r ehci_hcd
but as you know, that will only unload the module until next reboot.
The reason why I want to do this is because I am suspecting that module is responsible for crashing a RAID1 device composed of 2 8 GB USB drives connected to a PCI 4-port USB 2.0 hub in an old home server that only has USB 1.1 onboard ports available (I added the PCI hub in hopes that I could use the flash drives at USB 2.0 speeds). Maybe the hardware itself isn't capable of handling USB 2.0? Please correct me if my reasoning is faulty.
Any hints or suggestions will be more than welcome.

Last edited by gacanepa; 01-01-2014 at 12:04 PM.
 
Old 12-31-2013, 11:36 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Just rename the actual kernel module (under /usr/lib/modules... somewhere), and reboot. Rename it back after your testing.
 
1 members found this post helpful.
Old 01-01-2014, 12:47 AM   #3
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
Quote:
Originally Posted by syg00 View Post
Just rename the actual kernel module (under /usr/lib/modules... somewhere), and reboot. Rename it back after your testing.
That will work but it's /lib/modules/..... on Debian.

If you want to blacklist the ehci_hcd module, you must also blacklist the uhci_hcd module. There must some dependency going on, not sure.

You can do it from GRUB, but you must update GRUB's configuration files for it to take effect:
Code:
sudo update-grub
My preference would be to blacklist it from modprobe:
Code:
echo -e "blacklist ehci_hcd\nblacklist uchi_hcd" | sudo tee /etc/modprobe.d/ehci.conf

Last edited by towheedm; 01-01-2014 at 10:30 AM. Reason: Forgot blacklist in last code block
 
1 members found this post helpful.
Old 01-01-2014, 08:48 AM   #4
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Original Poster
Rep: Reputation: 27
Thanks syg00 and towheedm.
I'll tell you what I did.
1) I checked the dependencies of each module and it turns out that ehci_hcd does not depend on uhci_hcd. Instead, both depend on usbcore:
Code:
root@debian:~# modinfo ehci_hcd uhci_hcd | grep depends
depends:        usbcore
depends:        usbcore
root@debian:~#
However, I tried to blacklist both modules from modprobe, as towheedm suggested. I rebooted and found out that both modules were loaded automatically during boot. (Also, I forgot to add that I had updated grub configuration yesterday ).
2) I changed the name of the module file:
Code:
root@debian:~# modinfo ehci_hcd
filename:       /lib/modules/3.2.0-4-686-pae/kernel/drivers/usb/host/ehci-hcd.ko
license:        GPL
author:         David Brownell
description:    USB 2.0 'Enhanced' Host Controller (EHCI) Driver
alias:          pci:v*d*sv*sd*bc0Csc03i20*
depends:        usbcore
intree:         Y
vermagic:       3.2.0-4-686-pae SMP mod_unload modversions 686 
parm:           log2_irq_thresh:log2 IRQ latency, 1-64 microframes (int)
parm:           park:park setting; 1-3 back-to-back async packets (uint)
parm:           ignore_oc:ignore bogus hardware overcurrent indications (bool)
parm:           hird:host initiated resume duration, +1 for each 75us (int)
root@debian:~#
and rebooted. It appears the module is still being loaded:
Code:
root@debian:~# lsmod | grep usb
usb_storage            35142  0 
usbcore               104555  4 ehci_hcd,uhci_hcd,usb_storage
scsi_mod              135037  5 libata,sd_mod,sr_mod,sg,usb_storage
usb_common             12338  1 usbcore
root@debian:~# modinfo ehci_hcd
filename:       /lib/modules/3.2.0-4-686-pae/kernel/drivers/usb/host/ehci-hcd.ko
ERROR: could not get modinfo from 'ehci_hcd': No such file or directory
root@debian:~#
It just can't find the module information since I changed the module name... but somehow it keeps getting loaded... I'm kinda confused here.
FYI:
Code:
root@debian:~# ls /lib/modules/3.2.0-4-686-pae/kernel/drivers/usb/host
ehci-hcd.ko.bkp  hwa-hc.ko  isp116x-hcd.ko  ohci-hcd.ko  r8a66597-hcd.ko  sl811_cs.ko  sl811-hcd.ko  u132-hcd.ko  uhci-hcd.ko  whci  xhci-hcd.ko
root@debian:~#
Or maybe I'm doing something wrong.
Please advise.

Last edited by gacanepa; 01-01-2014 at 12:03 PM.
 
Old 01-01-2014, 09:51 AM   #5
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Original Poster
Rep: Reputation: 27
Update:
I just tried adding the following symlink to /etc/rc2.d:
Code:
root@debian:~# ln -s /etc/init.d/unload-ehci_hcd /etc/rc2.d/K01ehci_hcd
where unload-ehci_hcd contains:
Code:
modprobe -r ehci_hcd
It didn't work either .
Up to this point I am beginning to think that maybe the only permanent solution to this would be to recompile the kernel without the ehci_hcd module.

Last edited by gacanepa; 01-01-2014 at 12:03 PM.
 
Old 01-01-2014, 10:34 AM   #6
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
I forgot to include 'blacklist' in the last code block. It's edited now.

After trying it, neither the ehci_hcd or uhci_hcd drivers were loaded, which meant non of my usb devices worked after rebooting.

Again, the only way I could prevent the ehci_hcd from loading was to also blacklist the uhci_hcd module.

I did rename the ehci module in a VM, which prevented it from loading.
 
1 members found this post helpful.
Old 01-01-2014, 10:47 AM   #7
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
Renamed echi and rebooted. It was not loaded, but neither was the uhci driver.

Code:
sudo mv /lib/modules/3.2.0-4-686-pae/kernel/drivers/usb/host/ehci-hcd.ko ~/
Reboot and only the usbcore module is loaded.

Checking the kernel sources does not show a direct dependency between the two though.

Interesting, I will check this further.

BTW: Use code tags instead of quote tags for your code. It preserves formatting making it much easier to read.
 
1 members found this post helpful.
Old 01-01-2014, 12:18 PM   #8
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Original Poster
Rep: Reputation: 27
towheedm,
It worked!
This time I didn't rename the module (in the actual sense of the word) but moved it to root's home directory, just like you suggested earlier. Note that I just did this with the ehci_hcd module, not with uhci_hcd - and did not blacklist them in the .conf file inside the /etc/modprobe.d directory.
Then I updated the boot image and rebooted, and now the ehci_hcd module is not loading automatically anymore:
Code:
gacanepa@debian:~$ lsmod | grep usb
usbcore               104555  2 uhci_hcd
usb_common             12338  1 usbcore
gacanepa@debian:~$
I will mark all your posts and syg00's as helpful and this thread as solved. I will still have to check whether I can create the RAID1 device without issues, but that's a completely different story.
Thanks guys!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about /proc/acpi (Debian 7.2 w/ 3.2.0-4-686-pae kernel) gacanepa Linux - Newbie 0 12-28-2013 03:48 AM
[SOLVED] Can't boot kernel Debian wheezy 3.2.0-4 krchat Linux - Newbie 2 01-09-2013 01:45 AM
[SOLVED] 4GB RAM shows only 3GB on a 3.2.0 686-pae kernel (using LMDE) azurvii Linux - Hardware 11 12-29-2012 11:55 PM
[SOLVED] How to unload kernel module puntino Linux - Newbie 3 08-07-2012 06:11 AM
Better way to load/unload a kernel module seran Linux - General 3 06-23-2006 08:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration