Disable modules

Getting your soundcard to work, using Debian on non-i386 hardware, etc

Disable modules

Postby banderas20 » 2017-03-09 16:27

Hi all.

I am practising with
Code: Select all
lsmod
, and I'm trying to disable Bluetooth module to speed up the system, since I don't use it.

I have removed it using
Code: Select all
modprobe -r
but it appears again upon restart.
¿How can I avoid this behaviour?

Thanks!
banderas20
 
Posts: 23
Joined: 2016-11-10 15:30

Re: Disable modules

Postby wizard10000 » 2017-03-09 17:05

Easiest way? As root:

Code: Select all
systemctl stop bluetooth.service
systemctl disable bluetooth.service


Next easiest way? Uninstall bluetooth.

Next easiest way? Blacklist the kernel module.

Hope this helps -
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1027
Joined: 2011-05-09 20:02
Location: midwestern us

Re: Disable modules

Postby banderas20 » 2017-03-09 17:14

wizard10000 wrote:Easiest way? As root:

Code: Select all
systemctl stop bluetooth.service
systemctl disable bluetooth.service


Next easiest way? Uninstall bluetooth.

Next easiest way? Blacklist the kernel module.

Hope this helps -


If I stop bluetooth.service, ¿won't it load again when I restart?

BTW, according to https://wiki.archlinux.org/index.php/Ke ... acklisting,
Code: Select all
"but the module may be loaded if another non-blacklisted module depends on it or if it is loaded manually. "


My
Code: Select all
lsmod
output is this:

Code: Select all
bluetooth             374429  21 bnep,btusb


¿21 modules using bluetooth?
¿and yet only 2 listed?

Many thanks!
banderas20
 
Posts: 23
Joined: 2016-11-10 15:30

Re: Disable modules

Postby wizard10000 » 2017-03-09 17:17

If I stop bluetooth.service, ¿won't it load again when I restart?


Not if you disable the service :) Using systemctl you have to stop and then disable bluetooth. It won't start back up :)
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1027
Joined: 2011-05-09 20:02
Location: midwestern us

Re: Disable modules

Postby phenest » 2017-03-09 17:38

Do you have a BIOS setting to disable Bluetooth? Saves mucking around with software.
Dell XPS 17 L702X i7 2860QM 2.5GHz - 32GB RAM - 4G WWAN - Pioneer TD05-BDR
NEC Spirit 550 Pentium 4 3.6GHz HT - 2GB RAM - nVidia 7600GT - Promise TX4310 RAID + 4 SSD's - Pioneer BDR-209DBK
ASUS P8P67 EVO i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1037
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Disable modules

Postby wizard10000 » 2017-03-09 17:40

phenest wrote:Do you have a BIOS setting to disable Bluetooth? Saves mucking around with software.


There you go :)
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1027
Joined: 2011-05-09 20:02
Location: midwestern us

Re: Disable modules

Postby banderas20 » 2017-03-09 17:55

I didn't see the "disable" word.

Many thanks!
banderas20
 
Posts: 23
Joined: 2016-11-10 15:30

Re: Disable modules

Postby phenest » 2017-03-09 18:49

Probably not. You will see it's "enabled", yes? If so, change "enabled" to "disabled".
Dell XPS 17 L702X i7 2860QM 2.5GHz - 32GB RAM - 4G WWAN - Pioneer TD05-BDR
NEC Spirit 550 Pentium 4 3.6GHz HT - 2GB RAM - nVidia 7600GT - Promise TX4310 RAID + 4 SSD's - Pioneer BDR-209DBK
ASUS P8P67 EVO i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1037
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Disable modules

Postby pylkko » 2017-03-09 19:40

wizard10000 wrote:Easiest way? As root:

Code: Select all
systemctl stop bluetooth.service
systemctl disable bluetooth.service


Next easiest way? Uninstall bluetooth.

Next easiest way? Blacklist the kernel module.

Hope this helps -

Correct me if l'm wrong, but you need to use mask to prevent other software from reactivation bluetooth.service like:
Code: Select all
systemctl disable bluetooth
systemctl mask bluetooth

Also, this would only stop user space bluetooth stuff, the kernel would still load bluetooth.ko and all related things (hhid, bnep etc)
User avatar
pylkko
 
Posts: 785
Joined: 2014-11-06 19:02

Re: Disable modules

Postby wizard10000 » 2017-03-09 23:31

pylkko wrote:Correct me if l'm wrong, but you need to use mask to prevent other software from reactivation bluetooth.service like:
Code: Select all
systemctl disable bluetooth
systemctl mask bluetooth

Also, this would only stop user space bluetooth stuff, the kernel would still load bluetooth.ko and all related things (hhid, bnep etc)


Excellent point. Shutting it off in BIOS or blacklisting the driver works for me.
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1027
Joined: 2011-05-09 20:02
Location: midwestern us

Re: Disable modules

Postby banderas20 » 2017-03-10 11:26

wizard10000 wrote:Excellent point. Shutting it off in BIOS or blacklisting the driver works for me.


¿And how do you blacklist it? I have edited
Code: Select all
/etc/modprobe.d/blacklist.conf
with
Code: Select all
blacklist bluetooth
, then rebooted and still shows in
Code: Select all
lsmod
. :(
banderas20
 
Posts: 23
Joined: 2016-11-10 15:30

Re: Disable modules

Postby Segfault » 2017-03-10 11:28

It may be different with systemd ... my 2¢.
Segfault
 
Posts: 390
Joined: 2005-09-24 12:24

Re: Disable modules

Postby banderas20 » 2017-03-10 11:32

Segfault wrote:It may be different with systemd ... my 2¢.


Good point. I'll check it out. I'm using systemd on Debian7.

Thanks!
banderas20
 
Posts: 23
Joined: 2016-11-10 15:30

Re: Disable modules

Postby Thorny » 2017-03-11 14:16

banderas20 wrote:...and I'm trying to disable Bluetooth module to speed up the system, since I don't use it.


I wonder, what sort of "speed up" of the system do you expect to achieve by disabling an unused bluetooth module? I'm not suggesting that you shouldn't disable any module you want to but will you be able to measure or perceive a "speed up"?
Thorny
 
Posts: 266
Joined: 2011-02-27 13:40

Re: Disable modules

Postby banderas20 » 2017-03-11 14:54

Thorny wrote:
banderas20 wrote:...and I'm trying to disable Bluetooth module to speed up the system, since I don't use it.


I wonder, what sort of "speed up" of the system do you expect to achieve by disabling an unused bluetooth module? I'm not suggesting that you shouldn't disable any module you want to but will you be able to measure or perceive a "speed up"?


Maybe "speed up" is not the right word. But tune it to the specific needs. If I'm not going to use Bluetooth, I want to load just the necessary modules.
banderas20
 
Posts: 23
Joined: 2016-11-10 15:30

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable