LinuxQuestions.org
Help answer threads with 0 replies.
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, 08:27 PM   #1
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 203

Rep: Reputation: 26
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 01:04 PM.
 
Old 01-01-2014, 12:36 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
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, 01:47 AM   #3
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Jessie
Posts: 592

Rep: Reputation: 119Reputation: 119
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 11:30 AM. Reason: Forgot blacklist in last code block
 
1 members found this post helpful.
Old 01-01-2014, 09:48 AM   #4
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 203

Original Poster
Rep: Reputation: 26
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 01:03 PM.
 
Old 01-01-2014, 10:51 AM   #5
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 203

Original Poster
Rep: Reputation: 26
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 01:03 PM.
 
Old 01-01-2014, 11:34 AM   #6
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Jessie
Posts: 592

Rep: Reputation: 119Reputation: 119
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, 11:47 AM   #7
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Jessie
Posts: 592

Rep: Reputation: 119Reputation: 119
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, 01:18 PM   #8
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 203

Original Poster
Rep: Reputation: 26
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:48 AM
[SOLVED] Can't boot kernel Debian wheezy 3.2.0-4 krchat Linux - Newbie 2 01-09-2013 02:45 AM
[SOLVED] 4GB RAM shows only 3GB on a 3.2.0 686-pae kernel (using LMDE) azurvii Linux - Hardware 11 12-30-2012 12:55 AM
[SOLVED] How to unload kernel module puntino Linux - Newbie 3 08-07-2012 07:11 AM
Better way to load/unload a kernel module seran Linux - General 3 06-23-2006 09:19 AM


All times are GMT -5. The time now is 03:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration